MLKitObjectDetectionCommon Framework Reference

  • MLKObjectLabel provides information about an object detected within an image, including its textual description, index, and confidence score.

  • The text property describes the detected object, while index serves as a unique identifier for the label.

  • confidence indicates the model's certainty about the label's accuracy, typically ranging from 0 to 1.

  • Direct instantiation of MLKObjectLabel is prohibited; it is designed for internal use within the ML Kit framework.

MLKObjectLabel


@interface MLKObjectLabel : NSObject

A label that describes an object detected in an image.

  • The text returned here depends on the classifier model used.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull text;
  • The index of the label.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger index;
  • The confidence that the label applies to the detected object. Its range depends on the classifier model used, but by convention it should be [0, 1]. For an ObjectDetector created with ObjectDetectorOptions, the range is [0, 1].

    Declaration

    Objective-C

    @property (nonatomic, readonly) float confidence;
  • Unavailable.

    Declaration

    Objective-C

    - (nonnull instancetype)init;