terryky / tflite_gles_app

GPU accelerated deep learning inference applications for RaspberryPi / JetsonNano / Linux PC using TensorflowLite GPUDelegate / TensorRT
MIT License
488 stars 130 forks source link

Adding support for UYVY colorformat usb camer #12

Open palcode opened 3 years ago

palcode commented 3 years ago

Hi ,

The usb camera which we use all are having UYVY color format

Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1280/720 Pixel Format : 'UYVY' (UYVY 4:2:2) The by default support YUYV as seen from copy_yuyv_image function . Any pointers on how to add support for UYVY, which is not compute intensive. Regards Pallab Sarkar

terryky commented 3 years ago

Hi, It requires OpenGLES Shader code which runs on GPU. currently, shader code for YUYV format is ready as below. I think you can easily modify it to support UYVY. (just change the order.)

https://github.com/terryky/tflite_gles_app/blob/3c06adfefd93727b16089edadbf66474f9820a27/common/util_render2d.c#L130-L183

terryky commented 3 years ago

I've implemented to support UYVY color format. Could you try gl2blazeface ? (Since I don't have UYVY camera, I can't check it.)