Instance Method

prediction(from:)

Generates a prediction for given image.

Declaration

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

Parameters

image

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: URL) -> String

Generates a prediction for the image at the given URL.

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

Generates predictions for given the given array of images.