Try out openCV DNN API with Yolov5 model
1. Ubuntu 22.04
2. CUDA 11.8
3. cuDNN 8.7.0
4. g++ 11.3
5. cmake 3.22.1
6. OpenCV 4.6.0 (with CUDA backend - optional)
Comment these lines (in main.cpp) if you do not build openCV with CUDA backend
cout << "Attempt to use CUDA\n";
net.setPreferableBackend(dnn::DNN_BACKEND_CUDA);
net.setPreferableTarget(dnn::DNN_TARGET_CUDA);
In your command line, type
.../<project_dir>$ cmake .
.../<project_dir>$ make
To run the script, type in your command line
.../<project_dir>$ ./yolov5_cpp