MLKitObjectDetectionCustom Framework Reference

CustomObjectDetectorOptions

class CustomObjectDetectorOptions : CommonObjectDetectorOptions

Configurations for a custom-model object detector.

  • The confidence threshold for labels returned by the object detector. Labels returned by the object detector will have a confidence level higher or equal to the given threshold. The threshold is a floating-point value and must be in range [0, 1]. If unset or an invalid value is set, any classifier threshold specified by the model’s metadata will be used. If the model does not contain any metadata or the metadata does not specify a classifier threshold, the default threshold of 0.0 is used.

    Declaration

    Swift

    var classificationConfidenceThreshold: NSNumber? { get set }
  • The maximum number of labels to return for a detected object. Must be positive. If unset or an invalid value is set, the default value of 10 is used.

    Declaration

    Swift

    var maxPerObjectLabelCount: Int { get set }
  • Initializes a CustomObjectDetectorOptions instance with the given LocalModel.

    Declaration

    Swift

    init(localModel: MLKLocalModel)

    Parameters

    localModel

    An object classification model stored locally on the device.

    Return Value

    A new instance of CustomObjectDetectorOptions with the given LocalModel.

  • Unavailable.