MLKitObjectDetection 自訂架構參考資料

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

    儲存在裝置本機的自訂物件分類模型。

    傳回值

    具有指定 LocalModelCustomObjectDetectorOptions 新執行個體。

  • 使用指定的 CustomRemoteModel 並將 classificationConfidenceThreshold 屬性設為 nil 來初始化 CustomObjectDetectorOptions 執行個體。如未設定,系統會使用模型中繼資料中包含的可信度門檻值 (如有)。如果沒有,系統會改用 0.0 的值。

    聲明

    Objective-C

    - (nonnull instancetype)initWithRemoteModel:
        (nonnull MLKCustomRemoteModel *)remoteModel;

    參數

    remoteModel

    儲存在遠端儲存在伺服器上的自訂物件分類模型,並下載到裝置上。

    傳回值

    具有指定 CustomRemoteModelCustomObjectDetectorOptions 新執行個體。

  • 無法使用,

    聲明

    Objective-C

    - (nonnull instancetype)init;