Hello All,
Platform: Snapdragon 820 ( OpenQ-820 from Intrinsyc) Andriod API24
SNPE Version : 1.8.0
I was able to run and profile on time it takes for CPU/DSP/GPU to load DLC,build Network and Execute network using Inception_V3. However the precprocessing of images is being done offline ( .jpg to .raw ) using python script. I have a requirement of using preprocessing of images within the application (android apk ) as I will be getting images on my platform continously and need to process those as soon as they come.
How to go ahead with such requirement. Any pointers? Is there any tweak in SNPE 1.8?
Thanks
AK
Hi. Here are a couple thoughts. If you're using Caffe as your training framework, SNPE supports some image pre-processing options with Caffe (e.g. color space conversion and scaling). This is explained in detail in the SDK documentation. If not, you might look into using something like OpenCV to do the image pre-processing on device before passing images to SNPE.
Hi,
Yes, Image pre-processing can be done within the Android Application.
Here is the sample code(https://github.com/globaledgesoft/AIML-DashCam-App) 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 java file https://github.com/globaledgesoft/AIML-DashCam-App/blob/master/app/src/main/java/com/qc/dashcam/Helpers/BitmapToFloatArrayHelper.java
Hope this helps!
Thanks
Thanks, gesqdn-forum. You saved me.
Unfortunately, Qualcomm documentation for C++ usage is very premature.
It needs a huge update and review.