justadudewhohacks / opencv4nodejs

Nodejs bindings to OpenCV 3 and OpenCV 4
MIT License
4.94k stars 821 forks source link

OpenCV DNN GPU support #758

Open elb3k opened 4 years ago

elb3k commented 4 years ago

First of all I really appreciate this repo and all the contributors.

I want use OpenCV DNN module for inference.

Here are the details of installation:

  1. Latest opencv4nodejs
  2. OpenCV version: 4.3.0
  3. Build Additional flags: -DWITH_CUDA=ON -DWITH_CUDNN=ON -DOPENCV_DNN_CUDA=ON

Build has been successful. Currently I can use DNN module only on CPU.

In openCV documentation I have found setPreferableBackend and setPreferableTarget that is used to set CUDA Backend. But I could not have found similar API in this repo.

I am asking this as a feature request or any workaround is welcome.

OpenCV version : 4.3.0

With OpenCV-contrib? (extra modules): yes

OS: Ubuntu 18.04

elb3k commented 4 years ago

I have managed to port these functions and tested cv.Net in CUDA backend in fork and created pull request