MLKCustomObjectDetectorOptions
@interface MLKCustomObjectDetectorOptions : MLKCommonObjectDetectorOptions
自訂模型物件偵測工具的設定。
-
物件偵測工具傳回的標籤可信度門檻。物件偵測工具傳回的標籤的可信度等級會高於或等於指定的門檻。門檻是浮點值,必須介於 [0, 1] 之間。如未設定或設定無效值,系統會使用模型中繼資料指定的任何分類器門檻。如果模型不含任何中繼資料,或是中繼資料未指定分類器門檻,則會使用
0.0
的預設門檻。聲明
Objective-C
@property (nonatomic, nullable) NSNumber *classificationConfidenceThreshold;
-
要為偵測的物件傳回的標籤數量上限。必須為正數。如未設定或設定了無效值,系統會使用
10
的預設值。聲明
Objective-C
@property (nonatomic) NSInteger maxPerObjectLabelCount;
-
使用指定的
LocalModel
並將classificationConfidenceThreshold
屬性設為nil
來初始化CustomObjectDetectorOptions
執行個體。如未設定,系統會使用模型中繼資料中包含的可信度門檻值 (如有)。如果沒有,系統會改用0.0
的值。聲明
Objective-C
- (nonnull instancetype)initWithLocalModel:(nonnull MLKLocalModel *)localModel;
參數
localModel
儲存在裝置本機的自訂物件分類模型。
傳回值
具有指定
LocalModel
的CustomObjectDetectorOptions
新執行個體。 -
使用指定的
CustomRemoteModel
並將classificationConfidenceThreshold
屬性設為nil
來初始化CustomObjectDetectorOptions
執行個體。如未設定,系統會使用模型中繼資料中包含的可信度門檻值 (如有)。如果沒有,系統會改用0.0
的值。聲明
Objective-C
- (nonnull instancetype)initWithRemoteModel: (nonnull MLKCustomRemoteModel *)remoteModel;
參數
remoteModel
儲存在遠端儲存在伺服器上的自訂物件分類模型,並下載到裝置上。
傳回值
具有指定
CustomRemoteModel
的CustomObjectDetectorOptions
新執行個體。 -
無法使用,
聲明
Objective-C
- (nonnull instancetype)init;