Instance Method

prediction(from:)

Generates annotations for the detected objects in an image at the given URL.

Declaration

func prediction(from image: URL) throws -> MLObjectDetector.DetectedObjects

Parameters

image

The file URL for the image containing objects you want to detect.

Return Value

An array of annotations for the detected objects in the image.

See Also

Testing an Object Detector

func predictions(from: [URL]) -> [MLObjectDetector.DetectedObjects]

Generates annotations for the detected objects in each image in the given array of URLs.

typealias MLObjectDetector.DetectedObjects

An array of annotations for objects that the model has detected.

struct MLObjectDetector.ObjectAnnotation

The label, location, and confidence level of a detected object within an image.