MLKCustomObjectDetectorOptions
@interface MLKCustomObjectDetectorOptions : MLKCommonObjectDetectorOptions
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
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
10
is used.Declaration
Objective-C
@property (nonatomic) NSInteger maxPerObjectLabelCount;
-
Initializes a
CustomObjectDetectorOptions
instance using the givenLocalModel
with theclassificationConfidenceThreshold
property 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.0
will be used instead.Declaration
Objective-C
- (nonnull instancetype)initWithLocalModel:(nonnull MLKLocalModel *)localModel;
Parameters
localModel
A custom object classification model stored locally on the device.
Return Value
A new instance of
CustomObjectDetectorOptions
with the givenLocalModel
. -
Initializes a
CustomObjectDetectorOptions
instance using the givenCustomRemoteModel
with theclassificationConfidenceThreshold
property 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.0
will be used instead.Declaration
Objective-C
- (nonnull instancetype)initWithRemoteModel: (nonnull MLKCustomRemoteModel *)remoteModel;
Parameters
remoteModel
A custom object classification model stored remotely on the server and downloaded to the device.
Return Value
A new instance of
CustomObjectDetectorOptions
with the givenCustomRemoteModel
. -
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;