Page Summary
-
MLKCustomObjectDetectorOptionsconfigures custom-model object detectors, enabling control over confidence thresholds and the number of labels returned. -
It allows setting a confidence threshold for object labels, defaulting to the model's metadata or 0.0 if not specified.
-
Developers can limit the maximum number of labels per detected object, with a default of 10 if unset.
-
Initialization requires either a local or remote custom object classification model.
-
Directly initializing
MLKCustomObjectDetectorOptionswithinitis not allowed.
MLKCustomObjectDetectorOptions
@interface MLKCustomObjectDetectorOptions : MLKCommonObjectDetectorOptionsConfigurations 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.0is used.Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *classificationConfidenceThreshold; -
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
10is used.Declaration
Objective-C
@property (nonatomic) NSInteger maxPerObjectLabelCount; -
Initializes a
CustomObjectDetectorOptionsinstance using the givenLocalModelwith theclassificationConfidenceThresholdproperty set tonil. If that remains unset, it will use the confidence threshold value included in the model metadata, if available. If that does not exist, a value of0.0will be used instead.Declaration
Objective-C
- (nonnull instancetype)initWithLocalModel:(nonnull MLKLocalModel *)localModel;Parameters
localModelA custom object classification model stored locally on the device.
Return Value
A new instance of
CustomObjectDetectorOptionswith the givenLocalModel. -
Initializes a
CustomObjectDetectorOptionsinstance using the givenCustomRemoteModelwith theclassificationConfidenceThresholdproperty set tonil. If that remains unset, it will use the confidence threshold value included in the model metadata, if available. If that does not exist, a value of0.0will be used instead.Declaration
Objective-C
- (nonnull instancetype)initWithRemoteModel: (nonnull MLKCustomRemoteModel *)remoteModel;Parameters
remoteModelA custom object classification model stored remotely on the server and downloaded to the device.
Return Value
A new instance of
CustomObjectDetectorOptionswith the givenCustomRemoteModel. -
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;