public final class VisionBackends

  1. Object
  2. VisionBackends

Vision backend selectors. auto() chooses Apple Vision on iOS and ML Kit on Android. Feature-specific ML Kit methods are separate so one selector never adds unrelated OCR, barcode, face, pose, labeling, or segmentation pods.

Each ML Kit selector call is also a build-time dependency marker. The methods intentionally return the same runtime backend id but must remain distinct so the builder can include only the selected feature. Pass the selector that corresponds to the analyzer being constructed; for example, the face-detection selector cannot satisfy a text recognizer and that mismatched analyzer reports unsupported.

Methods

public static VisionBackend auto()
public static VisionBackend appleVision()Selects Apple Vision/Core Image without adding a third-party dependency.
public static VisionBackend mlKitTextRecognition()Selects ML Kit for text recognition on iOS.
public static VisionBackend mlKitBarcodeScanning()Selects ML Kit for barcode scanning on iOS.
public static VisionBackend mlKitFaceDetection()Selects ML Kit for face detection on iOS.
public static VisionBackend mlKitImageLabeling()Selects ML Kit for image labeling on iOS.
public static VisionBackend mlKitPoseDetection()Selects ML Kit for pose detection on iOS.
public static VisionBackend mlKitSelfieSegmentation()Selects ML Kit for selfie segmentation on iOS.

Inherited methods

Method details

auto

public static VisionBackend auto()

Returns

the dependency-minimal platform default

appleVision

public static VisionBackend appleVision()
Selects Apple Vision/Core Image without adding a third-party dependency.

Returns

Apple-native backend selector

mlKitTextRecognition

public static VisionBackend mlKitTextRecognition()
Selects ML Kit for text recognition on iOS. Android already uses ML Kit for the automatic backend.

Returns

the ML Kit backend selector

mlKitBarcodeScanning

public static VisionBackend mlKitBarcodeScanning()
Selects ML Kit for barcode scanning on iOS.

Returns

the ML Kit backend selector

mlKitFaceDetection

public static VisionBackend mlKitFaceDetection()
Selects ML Kit for face detection on iOS.

Returns

the ML Kit backend selector

mlKitImageLabeling

public static VisionBackend mlKitImageLabeling()
Selects ML Kit for image labeling on iOS.

Returns

the ML Kit backend selector

mlKitPoseDetection

public static VisionBackend mlKitPoseDetection()
Selects ML Kit for pose detection on iOS.

Returns

the ML Kit backend selector

mlKitSelfieSegmentation

public static VisionBackend mlKitSelfieSegmentation()
Selects ML Kit for selfie segmentation on iOS.

Returns

the ML Kit backend selector