diff --git a/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.h b/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.h index 024eee0a..549fa9fa 100644 --- a/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.h +++ b/mediapipe/tasks/ios/vision/image_classifier/sources/MPPImageClassifier.h @@ -85,6 +85,14 @@ NS_SWIFT_NAME(ImageClassifier) * interest. Rotation will be applied according to the `orientation` property of the provided * `MPPImage`. Only use this method when the `MPPImageClassifier` is created with * `MPPRunningModeImage`. + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If your `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color space is + * RGB with an Alpha channel. * * @param image The `MPPImage` on which image classification is to be performed. * @param error An optional error parameter populated when there is an error in performing image @@ -102,6 +110,15 @@ NS_SWIFT_NAME(ImageClassifier) * of the provided `MPPImage`. Only use this method when the `MPPImageClassifier` is created with * `MPPRunningModeImage`. * + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If your `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color space is + * RGB with an Alpha channel. + * * @param image The `MPPImage` on which image classification is to be performed. * @param roi A `CGRect` specifying the region of interest within the given `MPPImage`, on which * image classification should be performed. @@ -121,6 +138,18 @@ NS_SWIFT_NAME(ImageClassifier) * the provided `MPPImage`. Only use this method when the `MPPImageClassifier` is created with * `MPPRunningModeVideo`. * + * It's required to provide the video frame's timestamp (in milliseconds). The input timestamps must + * be monotonically increasing. + * + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If your `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color space is + * RGB with an Alpha channel. + * * @param image The `MPPImage` on which image classification is to be performed. * @param timestampInMilliseconds The video frame's timestamp (in milliseconds). The input * timestamps must be monotonically increasing. @@ -143,6 +172,15 @@ NS_SWIFT_NAME(ImageClassifier) * It's required to provide the video frame's timestamp (in milliseconds). The input timestamps must * be monotonically increasing. * + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If your `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color space is + * RGB with an Alpha channel. + * * @param image A live stream image data of type `MPPImage` on which image classification is to be * performed. * @param timestampInMilliseconds The video frame's timestamp (in milliseconds). The input @@ -165,6 +203,7 @@ NS_SWIFT_NAME(ImageClassifier) * image as region of interest. Rotation will be applied according to the `orientation` property of * the provided `MPPImage`. Only use this method when the `MPPImageClassifier` is created with * `MPPRunningModeLiveStream`. + * * The object which needs to be continuously notified of the available results of image * classification must confirm to `MPPImageClassifierLiveStreamDelegate` protocol and implement the * `imageClassifier:didFinishClassificationWithResult:timestampInMilliseconds:error:` @@ -173,6 +212,19 @@ NS_SWIFT_NAME(ImageClassifier) * It's required to provide a timestamp (in milliseconds) to indicate when the input image is sent * to the image classifier. The input timestamps must be monotonically increasing. * + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If the input `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color + * space is RGB with an Alpha channel. + * + * If this method is used for classifying live camera frames using `AVFoundation`, ensure that you + * request `AVCaptureVideoDataOutput` to output frames in `kCMPixelFormat_32RGBA` using its + * `videoSettings` property. + * * @param image A live stream image data of type `MPPImage` on which image classification is to be * performed. * @param timestampInMilliseconds The timestamp (in milliseconds) which indicates when the input @@ -192,6 +244,7 @@ NS_SWIFT_NAME(ImageClassifier) * specified region of interest.. Rotation will be applied according to the `orientation` property * of the provided `MPPImage`. Only use this method when the `MPPImageClassifier` is created with * `MPPRunningModeLiveStream`. + * * The object which needs to be continuously notified of the available results of image * classification must confirm to `MPPImageClassifierLiveStreamDelegate` protocol and implement the * `imageClassifier:didFinishClassificationWithResult:timestampInMilliseconds:error:` delegate @@ -199,6 +252,19 @@ NS_SWIFT_NAME(ImageClassifier) * * It's required to provide a timestamp (in milliseconds) to indicate when the input image is sent * to the image classifier. The input timestamps must be monotonically increasing. + * + * This method supports classification of RGBA images. If your `MPPImage` has a source type of + * `MPPImageSourceTypePixelBuffer` or `MPPImageSourceTypeSampleBuffer`, the underlying pixel buffer + * must have one of the following pixel format types: + * 1. kCVPixelFormatType_32BGRA + * 2. kCVPixelFormatType_32RGBA + * + * If the input `MPPImage` has a source type of `MPPImageSourceTypeImage` ensure that the color + * space is RGB with an Alpha channel. + * + * If this method is used for classifying live camera frames using `AVFoundation`, ensure that you + * request `AVCaptureVideoDataOutput` to output frames in `kCMPixelFormat_32RGBA` using its + * `videoSettings` property. * * @param image A live stream image data of type `MPPImage` on which image classification is to be * performed.