MediaPipeTasksVision Framework Reference

MPPClassifications


@interface MPPClassifications : NSObject

Represents the list of classification for a given classifier head. Typically used as a result for classification tasks.

  • The index of the classifier head these entries refer to. This is useful for multi-head models.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger headIndex;
  • The optional name of the classifier head, which is the corresponding tensor metadata name.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *headName;
  • An array of Category objects containing the predicted categories.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<MPPCategory *> *_Nonnull categories;
  • Initializes a new Classifications object with the given head index and array of categories. Head name is initialized to nil.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithHeadIndex:(NSInteger)headIndex
                                   categories:
                                       (nonnull NSArray<MPPCategory *> *)categories;

    Parameters

    headIndex

    The index of the classifier head.

    categories

    An array of Category objects containing the predicted categories.

    Return Value

    An instance of Classifications initialized with the given head index and array of categories.

  • Initializes a new Classifications with the given head index, head name and array of categories.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithHeadIndex:(NSInteger)headIndex
                                     headName:(nullable NSString *)headName
                                   categories:
                                       (nonnull NSArray<MPPCategory *> *)categories;

    Parameters

    headIndex

    The index of the classifier head.

    headName

    The name of the classifier head, which is the corresponding tensor metadata name.

    categories

    An array of Category objects containing the predicted categories.

    Return Value

    An object of Classifications initialized with the given head index, head name and array of categories.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;