MLKitImageLabelingCommon Framework Reference

  • ImageLabel represents a label assigned to an image by a classifier model.

  • Each label has text describing the label, index for its position, and confidence indicating the model's certainty.

  • The confidence value, typically ranging from 0 to 1, reflects the likelihood of the label's accuracy.

  • ImageLabel instances are generated by the classifier and cannot be directly initialized.

ImageLabel

class ImageLabel : NSObject

Represents a label for an image.

  • The text of the label returned by the classifier model.

    Declaration

    Swift

    var text: String { get }
  • The index of the label.

    Declaration

    Swift

    var index: Int { get }
  • The confidence of the label. Its range depends on the classifier model used, but by convention it should be [0, 1]. For an ImageLabeler created with ImageLabelerOptions, the range is [0, 1].

    Declaration

    Swift

    var confidence: Float { get }
  • Unavailable.