Using OpenCL with DNN on M1 Mac

I am new to using OpenCV. I have a python script that uses the DNN to do some video processing and it does not use the GPU when running.

I am using an M1 MacBook, which supports OpenCL.

I added these lines into my code:

But it still does not use the GPU.

How can I use GPU acceleration?

OpenCV 4.5.2-pre built for arm with WITH_OPENCL=ON
Running using python 3.8 on conda

did you build the python cv2 wrappers locally ?

please check, what cv2.getBuildInformation() has to say about opencl support

I followed the instructions exactly as they are here: Building and Installing OpenCV 4.5.0 on an M1 Mac | Sayak Paul

I am not sure what it means to build the wrapper. Did I do that in the steps in that link?

When I did cv2.getBuildInformation(), the output includes the following:

OpenCL: YES (no extra features)
Include path: NO
Link libraries: -framework OpenCL

Hello Kevin,

Have you fixed your issue ? I am having the same thing, I need your tips if you figure out how did you enable the gpu acceleration