Facial Recognition in Practice
by Fernando Koyanagi in Circuits > Software
1095 Views, 3 Favorites, 0 Comments
Facial Recognition in Practice
This is a subject I'm so fascinated for, that it makes me lose sleep: Computer Vision, the detection of objects and people through a pre-trained model.
Introduction
We will use the YoloV3 algorithm , to run an application and run the project.
I worked with neural network 15 years ago and I can say that these were “difficult” times, given the resources available at the time.
Resources Used
· Logitech C270 camera
· Computer
· NVIDIA GeForce GTX 1660
Prerequisites
To run deep neural networks (DNN) it is necessary to use parallel computing, with a GPU.
So you will need a powerful video card from NVIDIA and run the algorithm using the CUDA API ( GPU virtual instruction set ).
To run the algorithm you must first have the following packages installed:
- NVIDIA Video Card Drive
- CUDA
- CUDNN (CUDA Deep Neural Network Library)
- OpenCV
Computer Requirements
Setup YOLO
Detection using a pre-trained model
Open the terminal and enter the above commands.
Modify MakeFile
Modify the “MakeFile” file as in the figure above, because we will use GPU, CUDNN and OpenCV processing. After modifying, run the ‘make’ command.
Wait for It to Complete
The command 'make' in Step 7 will compile everything for use by the algorithms, and it takes a while to run.
For Computers That Don't Match the Requirements
If your computer and video card are not as powerful or you want better performance, change the file 'cfg /yolov3.cfg'.
The above configuration was used in this project.
YOLO V3
Detection systems typically apply the model to an image at several different locations and scales.
YOLO applies a single neural network to the entire image. This network divides the image into regions and provides bounding boxes and probabilities for each region.
YOLO has several advantages. It sees the image as a whole, so its predictions are generated by the global context in the image.
It makes predictions with a single network assessment, unlike R-CNN which makes thousands of assessments for a single image.
It is up to 1000 times faster than R-CNN and 100 times faster than Fast R-CNN.
Running YOLO
To run YOLO, just open the terminal in the “ darknet ” folder and enter a command.
You can run YOLO in 4 ways:
· Image
· Multiple Images
· Streaming (Webcam)
· Video
YOLO V3 - Image
Place the image you want in the “data” folder inside darknet and after that run the command above modifying the image name.
YOLO V3 - Input Image
YOLO V3 - Output Image
YOLO V3 - Multiple Images
Place the images in some folder, and instead of providing the image path, leave it blank and run the command as you can see above (in the left).
After that, something like the figure in the right will appear, just place the image path and click on “ enter ” and repeat these steps for several images.
YOLO V3 - WebCam
Run the command above and after loading the network, the webcam will appear.
YOLO V3 - Video
Place the video you want in the “data” folder inside darknet and after that run the command above modifying the video name.