I am trying to use the default face_recognition (dlib, Pillow, numpy, etc) models in python as part of opencv2 library. When I tried to run it with CNN based models then the device hangs.
Does it has support GPU accelerator support internally linked or anyway to use the GPU engine of Jetson Nano to run CNN models ?
If your library is built with CUDA support, it should use cuDNN for inference automatically.
To check if dlib has GPU support, you can test it with the following command:
import dlib.cuda as cuda
Its throwing error as follows,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dlib.cuda'
How Can i install the dlib for CUDA
You can find some information for building
dlib with GPU support here:
The fix is adding the cuDNNv8 new API support.
And it is available in the newest dlib-19.21 release in Aug 8.
So you can build it from source directly:
$ sudo apt-get install python3-pip
$ sudo apt-get install libjpeg-dev
Build dlib from source
$ wget http://dlib.net/files/dlib-19.21.tar.bz2
$ tar jxvf dlib-19.21.tar.bz2
$ cd dlib-19.21/
$ mkdir build
$ cd build/
$ cmake ..
$ cmake --build .
$ cd ../
$ sudo python3 setup.py install
$ sudo pip3 install face_recogni…