Vision

class Vision : NSObject

A Firebase service that supports vision APIs.

  • Enables stats collection in ML Kit vision. The stats include API call counts, errors, API call durations, options, etc. No personally identifiable information is logged.

    The setting is per FirebaseApp, and therefore per Vision, and it is persistent across launches of the app. It means if the user uninstalls the app or clears all app data, the setting will be erased. The best practice is to set the flag in each initialization.

    By default the logging is enabled. You have to specifically set it to false to disable logging.

    Declaration

    Swift

    var isStatsCollectionEnabled: Bool { get set }
  • Gets an instance of Firebase Vision service for the default Firebase app. This method is thread safe. The default Firebase app instance must be configured before calling this method; otherwise raises FIRAppNotConfigured exception.

    Declaration

    Swift

    class func vision() -> Self

    Return Value

    A Firebase Vision service instance, initialized with the default Firebase app.

  • Gets an instance of Firebase Vision service for the custom Firebase app. This method is thread safe.

    Declaration

    Swift

    class func vision(app: FIRApp) -> Self

    Parameters

    app

    The custom Firebase app used for initialization. Raises FIRAppInvalid exception if app is nil.

    Return Value

    A Firebase Vision service instance, initialized with the custom Firebase app.

  • Unavailable.

  • Gets a barcode detector with the given options. The returned detector is not thread safe.

    Declaration

    Swift

    func barcodeDetector(options: FIRVisionBarcodeDetectorOptions) -> FIRVisionBarcodeDetector

    Parameters

    options

    Options containing barcode detector configuration.

    Return Value

    A barcode detector configured with the given options.

  • Gets a barcode detector with the default options. The returned detector is not thread safe.

    Declaration

    Swift

    func barcodeDetector() -> FIRVisionBarcodeDetector

    Return Value

    A barcode detector configured with the default options.

  • Gets a face detector with the given options. The returned detector is not thread safe.

    Declaration

    Swift

    func faceDetector(options: FIRVisionFaceDetectorOptions) -> FIRVisionFaceDetector

    Parameters

    options

    Options for configuring the face detector.

    Return Value

    A face detector configured with the given options.

  • Gets a face detector with the default options. The returned detector is not thread safe.

    Declaration

    Swift

    func faceDetector() -> FIRVisionFaceDetector

    Return Value

    A face detector configured with the default options.

  • Gets a label detector with the given options. The returned detector is not thread safe.

    Declaration

    Swift

    func labelDetector(options: FIRVisionLabelDetectorOptions) -> FIRVisionLabelDetector

    Parameters

    options

    Options for configuring the label detector.

    Return Value

    A label detector configured with the given options.

  • Gets a label detector with the default options. The returned detector is not thread safe.

    Declaration

    Swift

    func labelDetector() -> FIRVisionLabelDetector

    Return Value

    A label detector configured with the default options.

  • Gets an on-device text recognizer. The returned recognizer is not thread safe.

    Declaration

    Swift

    func onDeviceTextRecognizer() -> FIRVisionTextRecognizer

    Return Value

    A text recognizer.

  • Gets a cloud text recognizer configured with the given options. The returned recognizer is not thread safe.

    Declaration

    Swift

    func cloudTextRecognizer(options: FIRVisionCloudTextRecognizerOptions) -> FIRVisionTextRecognizer

    Parameters

    options

    Options for configuring the cloud text recognizer.

    Return Value

    A text recognizer configured with the given options.

  • Gets a cloud text recognizer. The returned recognizer is not thread safe.

    Declaration

    Swift

    func cloudTextRecognizer() -> FIRVisionTextRecognizer

    Return Value

    A text recognizer.

  • Gets a cloud document text recognizer configured with the given options. The returned recognizer is not thread safe.

    Declaration

    Swift

    func cloudDocumentTextRecognizer(options: FIRVisionCloudDocumentTextRecognizerOptions) -> FIRVisionDocumentTextRecognizer

    Parameters

    options

    Options for configuring the cloud document text recognizer.

    Return Value

    A document text recognizer configured with the given options.

  • Gets a cloud document text recognizer. The returned recognizer is not thread safe.

    Declaration

    Swift

    func cloudDocumentTextRecognizer() -> FIRVisionDocumentTextRecognizer

    Return Value

    A document text recognizer.

  • Gets an instance of cloud landmark detector with the given options.

    Declaration

    Swift

    func cloudLandmarkDetector(options: FIRVisionCloudDetectorOptions) -> FIRVisionCloudLandmarkDetector

    Parameters

    options

    Options for configuring the cloud landmark detector.

    Return Value

    A cloud landmark detector configured with the given options.

  • Gets an instance of cloud landmark detector with default options.

    Declaration

    Swift

    func cloudLandmarkDetector() -> FIRVisionCloudLandmarkDetector

    Return Value

    A cloud landmark detector configured with default options.

  • Undocumented

    Declaration

    Swift

    func cloudLabelDetector(options: FIRVisionCloudDetectorOptions) -> FIRVisionCloudLabelDetector
  • Gets an instance of cloud label detector with default options.

    Declaration

    Swift

    func cloudLabelDetector() -> FIRVisionCloudLabelDetector

    Return Value

    A cloud label detector configured with default options.