I would like to feed video stream to SNPE so that the neural network model can infer the object in the video frames live, can anyone enlighten me on what is the best way to achieve this goal? I am quite new to Android development and relatively new to Linux development as well. Any advice would be very much appreciated.
The development board that I am using is Qualcomm S820a ADP.
Best regards,
Hi,
Yes, Image pre-processing can be done within the Android Application.
Here is the sample code for an Android Application using Mobilenet SSD for object detection. The model is provided with the pre-processed images where the input is received from the camera feed.
Steps followed for pre-processing the image in Android App:
1. Resize the image/bitmap size according to the input size required by the model.
2. Convert Bitmap to buffer(RGBA byte array)
3. Process pixels RGBA(0..255) to BGR(-1..1)
This will convert Bitmap (300,300,4 ints) to Float Input Tensor (300,300,3 floats)
For code reference for the above steps, please follow this class https://github.com/globaledgesoft/AIML-DashCam-App/blob/master/app/src/main/java/com/qc/dashcam/Helpers/BitmapToFloatArrayHelper.java
Hope this helps!
Thanks