MediaPipeTasksVision Framework Reference

MPPClassificationResult


@interface MPPClassificationResult : NSObject

Represents the classification results of a model. Typically used as a result for classification tasks.

  • An Array of Classifications objects containing the predicted categories for each head of the model.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<MPPClassifications *> *_Nonnull classifications;
  • The optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results. If it is set to the value -1, it signifies the absence of a timestamp. This is only used for classification on time series (e.g. audio classification). In these use cases, the amount of data to process might exceed the maximum size that the model can process: to solve this, the input data is split into multiple chunks starting at different timestamps.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger timestampInMilliseconds;
  • Initializes a new ClassificationResult with the given array of classifications and time stamp (in milliseconds).

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithClassifications:
            (nonnull NSArray<MPPClassifications *> *)classifications
        timestampInMilliseconds:(NSInteger)timestampInMilliseconds;

    Parameters

    classifications

    An Array of Classifications objects containing the predicted categories for each head of the model.

    timestampInMilliseconds

    The timestamp (in milliseconds) of the start of the chunk of data corresponding to these results.

    Return Value

    An instance of ClassificationResult initialized with the given array of classifications and timestamp (in milliseconds).

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;