OpenCV DNN issues in Android device (cv::gemm() bottleneck).

asked 2017-09-26 02:27:15 -0600

Gensoukyou1337 gravatar image

updated 2017-09-26 04:04:38 -0600

As of now I've successfully included the DNN module (dnn_modern) from opencv-contrib into my current OpenCV 3.3.0 build for Android ARM, and am intending to use the Gil-Levi Caffe model for gender and age detection. The problem is that when I use it on a face submat, the whole app slows down to around 0.37 FPS.

I've heard from other questions that cv::gemm() is the prime bottleneck of the current DNN implementation, and that replacing said function with the one from MKL or OpenBLAS can solve it. The problem is that I'm building for Android devices, so should I include it in my CMake toolchain somehow, or should I just modify the source (and how do I modify it)?

EDIT: And while we're at it, what other optimizations can I make?

edit retag flag offensive close merge delete

Comments

@Gensoukyou1337, dnn_modern module is just a wrapper of tiny-dnn framework. Does it use cv::gemm?

dkurt gravatar imagedkurt ( 2017-09-26 05:33:02 -0600 )edit

I just realized it doesn't.

Gensoukyou1337 gravatar imageGensoukyou1337 ( 2017-09-26 11:01:05 -0600 )edit