Contents

prediction(from:)

Locates objects in an image and generates an annotation for each object it detects.

Declaration

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

Parameters

  • image:

    The URL for the image file where you want the object detector to look for objects.

Return Value

An MLObjectDetector.DetectedObjects instance — which is an MLObjectDetector.ObjectAnnotation array — where each annotation represents an item the object detector found in the image.

See Also

Testing an object detector