MLKitObjectDetectionCommon 框架参考

MLKObjectLabel


@interface MLKObjectLabel : NSObject

描述在图片中检测到的对象的标签。

  • 此处返回的文本取决于所使用的分类器模型。

    声明

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull text;
  • 标签的索引。

    声明

    Objective-C

    @property (nonatomic, readonly) NSInteger index;
  • 该标签适用于检测到的对象的置信度。其范围取决于所使用的分类器模型,但按照惯例,它应为 [0, 1]。对于使用 ObjectDetectorOptions 创建的 ObjectDetector,范围为 [0, 1]。

    声明

    Objective-C

    @property (nonatomic, readonly) float confidence;
  • 不可用。

    声明

    Objective-C

    - (nonnull instancetype)init;