ObjectDetector
final class ObjectDetectorDetects objects and their pixel-space bounding boxes across images, video frames, and live camera streams.
-
Creates an
ObjectDetectorin.imagemode using the model file atmodelPath.Declaration
Swift
convenience init(modelPath: String) throws -
Creates an
ObjectDetectorconfigured withoptions.Declaration
Swift
init(options: ObjectDetectorOptions) throws -
Detects objects in a standalone
image(.imagerunning mode only).Declaration
Swift
final func detect(image: MPImage, imageProcessingOptions: ImageProcessingOptions? = nil) throws -> ObjectDetectorResult -
Detects objects in a sequential
videoFrameat monotonically increasingtimestampInMilliseconds(.videorunning mode only).Declaration
Swift
final func detect(videoFrame: MPImage, timestampInMilliseconds: Int, imageProcessingOptions: ImageProcessingOptions? = nil) throws -> ObjectDetectorResult -
Submits a live camera
imageat monotonically increasingtimestampInMillisecondsfor asynchronous result delivery (.liveStreamrunning mode only).Declaration
Swift
final func detectAsync(image: MPImage, timestampInMilliseconds: Int, imageProcessingOptions: ImageProcessingOptions? = nil) throws