Initialize OpenCL Runtime

asked 2018-12-15 11:53:17 -0600

phillity gravatar image

Hi everyone

I am making a web app which uses some OpenCV functions on the backend. The first time I use the forward method of cv2.dnn it takes a bit of time. I also get this message: [ INFO:0] Initialize OpenCL runtime

Right now, I just have a background thread to load a model and forward an image. This way when an image actually needs to be forwarded through some dnn model, I will have already initialized the OpenCL runtime. Then the delay will not be experienced on the user thread

Is there a better way to handle this? Is there a way to directly initialize OpenCL runtime without loading a model and an image? Thanks!

edit retag flag offensive close merge delete

Comments

1

any other operation using opencl should do, e.g. a GaussianBlur with a UMat.

berak gravatar imageberak ( 2018-12-16 01:28:32 -0600 )edit