Ask Your Question
0

Is it possible to use OpenCL with OpenCV and DNN/Tensorflow

asked 2018-06-21 07:38:35 -0600

paatz04 gravatar image

Is there a way to make use of OpenCL for improved performance when using the OpenCV.DNN ?

Thanks!

Best regards, Patric

edit retag flag offensive close merge delete

Comments

Here some performance measurements for opencv https://github.com/opencv/opencv/wiki...

holger gravatar imageholger ( 2018-06-26 07:25:44 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-26 04:48:59 -0600

holger gravatar image

updated 2018-06-26 06:17:40 -0600

Ok - first of all - open cl is transparent - if it is available, it will be used. Look here : https://opencv.org/platforms/ "OpenCL accelerated branches transparently added to the original API functions and are used automatically when possible/sensible..." So open cl for dnn will be used if available.

On the other hand, cuda for dnn ist NOT supported. https://opencv.org/platforms/cuda.html

My personal experience/impression is that evaluating model on cuda(with the native dnn it was trained on) is way more performant than evluating the model with open cv on top of open cl. But please measure by yourself!

edit flag offensive delete link more

Comments

Thank you for the great explanation holger! That makes sense. Do you know if this also applies to mobile/android?

paatz04 gravatar imagepaatz04 ( 2018-07-04 06:55:51 -0600 )edit

Not sure - i really want to encourage you to measure by yourself! Compile with open cl support and measure it. Assumptions are usually wrong - measure it!

holger gravatar imageholger ( 2018-07-04 07:18:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-21 07:38:35 -0600

Seen: 1,637 times

Last updated: Jun 26 '18