Color Format Requirements for Input in Apples MLModel of DeepLabV3

I am sending CVPixelBuffers to the input of the DeepLabV3 MLModel. I am of the understanding that it requires pixel color format 32ARGB or 32RGBA. Correct?

Can 32BRGA be input? CVPixelBuffers support 32BRGA and OpenCV as well. Please note, I want to use the MLModel as trained.

Neither 32RGBA no 32ARGB are supported for type CVPixelBuffer.

32ARGB: An unsupported runtime error occurs with the configuration as follows... func configureOutput() { videoOutput.setSampleBufferDelegate(self, queue: bufferQueue) videoOutput.alwaysDiscardsLateVideoFrames = true videoOutput.videoSettings = [String(kCVPixelBufferPixelFormatTypeKey): kCMPixelFormat_32ARGB].

32RGBA: "Cannot find 'kCMPixelFormat_32rgba' in scope."

The app process: Video captured pixelBuffers are sent to c++ code where openCV operations are done, creating up to 3 smaller Mats which are then converted back into pixel buffers in the Objective-C. These converted PixedBuffer are used in three ways. All are sent to the MLModel for image segmentation to identify people; the files may be sent to the photo library; or may simply be viewed on the screen. I need a color format that can support all these down stream operations/pipelines.

Replies

Hello,

Can 32BRGA be input?

I'm assuming this was a typo and you meant "kCVPixelFormatType_32BGRA", yes that format is supported, are you running into an issue when you use it?

  • Yes I meant kCVPixelFormatType_32BGRA. I'm afraid I don't have all the feedback I needed to tell which would be taking the multiArray and making an image from it. I use the multiArray to determine peoples location to a line. Thank you for your assistance. I will have to work through how to make an image from the multiArray in the future. It looked challenging to me. Thanks again.

Add a Comment