The Mobile Vision API is now a part of ML Kit. We strongly encourage you to try it out, as it comes with new capabilities like on-device image labeling! Also, note that we ultimately plan to wind down the Mobile Vision API, with all new on-device ML capabilities released via ML Kit. Feel free to reach out to Firebase support for help.

GMVDetector Class

GMVDetector Class Reference

Overview

A GMVDetector object uses image processing to search for and identify notable features in a still image or video.

Detected features are represented by GMVFeature objects that provide more information about each feature.

Inherits NSObject.

Instance Method Summary

(NSArray< __kindof GMVFeature * > *) - featuresInImage:options:
 Searches for features in an image. More...
 
(NSArray< __kindof GMVFeature * > *) - featuresInBuffer:options:
 Searches for features in an image buffer. More...
 
(NSString *const
GMVDetectorResultCoordinateSpace) 
- __attribute__
 

Class Method Summary

(GMVDetector *) + detectorOfType:options:
 Creates and returns a configured detector. More...
 

Public Attributes

NSString *const GMVDetectorTypeFace
 
NSString *const GMVDetectorTypeBarcode
 
NSString *const GMVDetectorTypeText
 
NSString *const GMVDetectorBarcodeFormats
 
NSString *const GMVDetectorFaceMode
 
NSString *const GMVDetectorFaceTrackingEnabled
 
NSString *const GMVDetectorFaceMinSize
 
NSString *const GMVDetectorFaceClassificationType
 
NSString *const GMVDetectorFaceLandmarkType
 
NSString *const GMVDetectorImageOrientation
 

Method Detail

+ (GMVDetector *) detectorOfType: (NSString *)  type
options: (NSDictionary *)  options 

Creates and returns a configured detector.

Parameters
typeIdentifies which type of detector should be created.
optionsConfiguration options for the detector.
- (NSArray<__kindof GMVFeature *> *) featuresInImage: (UIImage *)  image
options: (NSDictionary *)  options 

Searches for features in an image.

Parameters
optionsConfiguration options for runtime detection. Use the GMVDetectorImageOrientation key to specify the image orientation.
- (NSArray<__kindof GMVFeature *> *) featuresInBuffer: (CMSampleBufferRef)  sampleBuffer
options: (NSDictionary *)  options 

Searches for features in an image buffer.

Parameters
optionsConfiguration options for runtime detection. Use the GMVDetectorImageOrientation key to specify the image orientation.
- (NSString *const GMVDetectorResultCoordinateSpace) __attribute__ ((deprecated)) 

A key used to specify the coordinate space of detection results. The value of this key is an NSNumber wrapping a GMVResultCoordinateSpace. If not specified, it defaults to GMVResultCaptureDeviceCoordinateSpace.

Prior to 1.2.0, the GMVDetector always returns results in GMVResultCaptureDeviceEXIFCoordinateSpace. This option exists as a migration option. The detection results for future releases will only be in GMVResultCaptureDeviceCoordinateSpace.

Member Data Documentation

- (NSString* const) GMVDetectorTypeFace

A detector that searches for faces in a still image or video, returning GMVFaceFeature objects that provide information about detected faces.

- (NSString* const) GMVDetectorTypeBarcode

A detector that searches for barcodes in a still image or video, returning GMVBarcodeFeature objects that provide information about detected barcodes.

- (NSString* const) GMVDetectorTypeText

A detector that does optical character recognition in a still image or video, returning GMVTextBlockFeature objects that provide information about detected text.

- (NSString* const) GMVDetectorBarcodeFormats

A key used to specify the barcode detection formats. If not specified, defaults to GMVDetectorBarcodeFormatAllFormats.

- (NSString* const) GMVDetectorFaceMode

A key used to specify detector's accuracy/speed trade-offs. If not specified, defaults to GMVDetectorFaceFastMode.

- (NSString* const) GMVDetectorFaceTrackingEnabled

A key used to specify is face tracking feature enabled. If not specified, defaults to false.

- (NSString* const) GMVDetectorFaceMinSize

A key used to specify the smallest desired face size. The size is expressed as a proportion of the width of the head to the image width. For example, if a value of 0.1 is specified, then the smallest face to search for is roughly 10% of the width of the image being searched. If not specified, defaults to 0.1.

- (NSString* const) GMVDetectorFaceClassificationType

A key used to specify whether to run additional classifiers for characterizing attributes such as smiling. If not specified, defaults to GMVDetectorFaceClassificationNone.

- (NSString* const) GMVDetectorFaceLandmarkType

A key used to specify whether to detect no landmarks or all landmarks. Processing time increases as the number of landmarks to search for increases, so detecting all landmarks will increase the overall detection time. If not specified, defaults to GMVDetectorFaceLandmarkNone.

- (NSString* const) GMVDetectorImageOrientation

A key used to specify the display orientation of the image for face feature detection. The value of this key is an NSNumber wrapping a GMVImageOrientation.