Facial Recognition in Practice

by Fernando Koyanagi in Circuits > Software

1069 Views, 2 Favorites, 0 Comments

Facial Recognition in Practice

Reconhecimento facial na prática!

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

01.png
01.1.png

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

06.png

Prerequisites

08.png
09.png

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

11.png

Setup YOLO

13.1.png

Detection using a pre-trained model

Open the terminal and enter the above commands.

Modify MakeFile

13.2.png

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

14.2.png

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

15.png

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

17.png

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

18.png
20.png

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

21.jpg

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

22.png

YOLO V3 - Output Image

23.png

YOLO V3 - Multiple Images

24.jpg

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

25.26.jpg

Run the command above and after loading the network, the webcam will appear.

YOLO V3 - Video

27.jpg

Place the video you want in the “data” folder inside darknet and after that run the command above modifying the video name.

YOLO V3 - EXPO3D Video 1

28.png

YOLO V3 - Video EXPO3D 2

29.png

YOLO V3 - Video EXPO3D 3

30.png

PDF to Download