rainyl / opencv_dart

OpenCV bindings for Dart language and Flutter. Support Asynchronous Now!
https://pub.dev/packages/opencv_dart
Apache License 2.0
136 stars 18 forks source link

Can we please have GPU support? #219

Open xonaman opened 3 months ago

xonaman commented 3 months ago

Is your feature request related to a problem? Please describe. Not a problem, but GPU utilization would make a good performance boost.

Describe the solution you'd like OpenCV offers types like cv::GpuMat via the CUDA module, which bindings could be implemented to.

Describe alternatives you've considered GPU is THE alternative to CPU image processing.

Additional context The following graphic from here should say all you need to know. perf

rainyl commented 3 months ago

Yes, it's in consideration. But it's just not easy and lots of works todo, and i have no much time, will work on in the future.

abdelaziz-mahdy commented 2 months ago

what needs to be implemented to make it work? maybe i can help in it when i get time too

rainyl commented 2 months ago

@abdelaziz-mahdy basically something like https://github.com/hybridgroup/gocv/tree/release/cuda

and of course, a nvidia GPU is required to test it🤣

abdelaziz-mahdy commented 2 months ago

@abdelaziz-mahdy basically something like https://github.com/hybridgroup/gocv/tree/release/cuda

and of course, a nvidia GPU is required to test it🤣

Mission failed for me then 😂

rainyl commented 2 months ago

me too. I am developing on a laptop without a NVIDIA GPU equipped, so not active on this.

If any one want to work on this, refer to https://github.com/hybridgroup/gocv/tree/release/cuda

frg-x commented 3 weeks ago

Why do you recall CUDA if mobile devices have their own GPUs, not related to CUDA?

@abdelaziz-mahdy basically something like https://github.com/hybridgroup/gocv/tree/release/cuda

and of course, a nvidia GPU is required to test it🤣

abdelaziz-mahdy commented 3 weeks ago

Why do you recall CUDA if mobile devices have their own GPUs, not related to CUDA?

@abdelaziz-mahdy basically something like https://github.com/hybridgroup/gocv/tree/release/cuda

and of course, a nvidia GPU is required to test it🤣

I think he wants it for windows and Linux,

Mobile gpu support can be achieved using vulkan, but it's performance is still not that good I think and I don't know if matgpu supports it or not

rainyl commented 3 weeks ago

Well, GPU backends such as OpenCL and Vulkan on mobile devices have been supported.

frg-x commented 3 weeks ago

How to enable GPU processing? Is GPU-processing support implemented in opencv_dart API?

Well, GPU backends such as OpenCL and Vulkan on mobile devices have been supported.

rainyl commented 3 weeks ago

How to enable GPU processing? Is GPU-processing support implemented in opencv_dart API?

Well, GPU backends such as OpenCL and Vulkan on mobile devices have been supported.

What processing? if you mean the methods like "cv::cuda::threshold", they are not supported by opencv on mobile devices.

GPU backends like OpenCL are used for dnn-related inferences, they are supported both in opencv_core and opencv_dart for now. If you want to enable them, please refer to the document of opencv.