Sample code of testing functions of OpenCV with CUDA-enabled DNN modules.
$ cd yolos
$ wget https://pjreddie.com/media/files/yolov3.weights
$ cd ..
Then go to either Python or C++ part to validate the installation of OpenCV with CUDA-enabled DNN modules.
Thanks for YashasSamaga providing a quick dirty way to measure FPS. You can visit his work about this:
As C++ part, I adapted some lines from the following (written by YashasSamaga):
Also, he provides the way to compile OpenCV version 4.x without errors: