Instance Method

prediction(from:)

Generates a prediction for the image at the given URL.

Declaration

func prediction(from image: URL) throws -> String

Parameters

image

The URL of the image you want the model to classify.

Return Value

The label that the model predicts for the given image.

See Also

Testing an Image Classifier

func prediction(from: CGImage) -> String

Generates a prediction for given image.

func predictions(from: [URL]) -> [String]

Generates predictions for given the given array of images.