How to run OpenCV DNN ON GPU ANDROID

asked 2019-09-21 09:15:45 -0600

eagle77 gravatar image

updated 2019-09-21 09:18:51 -0600

Hello everybody, I recently tested my pre trained MobileNet on my android machine by using dnn module in c++. It seems my code is only computing on CPU. I used OPENCV ANDROID v.3.4.6 and 4 and I tried to set:

cv::ocl::setUseOpenCL(true);
cv::setNumThreads(2);
net.setPreferableBackend(DNN_TARGET_OPENCL);
net.setPreferableTarget(DNN_TARGET_OPENCL);
setUseOptimized(true);

but seems that the app run on the CPU with only 3,92 FPS @1024x768 My GPU is a ARM Mali-G71 MP2.

OpenCV is not the best way to run a DNN on a Android GPU? Where I'm wrong ?

Thank you for your help. Francesco

edit retag flag offensive close merge delete

Comments

No you are not wrong- Forget about OpenCV DNN on GPU(sad story - but i guess its a political thing as intel does not like nvidia).

Everyone knows it but no one is responding because they are unsure about the tech details on that. Just invest your time into running your model natively.

holger gravatar imageholger ( 2019-09-23 17:01:10 -0600 )edit

@holger Thank you for your reply.. !! I was hoping it would have been easier as in matlab, but I have to sweat.

eagle77 gravatar imageeagle77 ( 2019-10-01 10:42:18 -0600 )edit