2020-11-08 22:32:13 +00:00
|
|
|
Here, I introduce another library named "Dlib", which is a computer vision library always cooped with opencv.
|
|
|
|
So to run the demo, we need to install Dlib on our system.
|
2021-01-19 21:33:38 +00:00
|
|
|
1. I found tutorials to install dlib, and it worked for my device (Win10).
|
2020-11-08 22:32:13 +00:00
|
|
|
|
2021-01-19 21:33:38 +00:00
|
|
|
https://www.learnopencv.com/install-opencv-3-and-dlib-on-windows-python-only/ (I have tried and it did work well)
|
|
|
|
https://www.pyimagesearch.com/2017/05/01/install-dlib-raspberry-pi/ (I haven't get a chance to test on my Pi)
|
2020-11-08 22:32:13 +00:00
|
|
|
|
2021-01-19 21:33:38 +00:00
|
|
|
Note that to install on windows, make sure you have CMAKE and Visual Studio 2017 installed.
|
2020-11-08 22:32:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
2. How to use:
|
|
|
|
a. Add custom face dataset
|
|
|
|
1. Open "Facial_Recognition_Registration.py".
|
2021-01-19 21:33:38 +00:00
|
|
|
2. If using the laptop camera, make sure "cap = cv2.VideoCapture(0)" (at line 17);
|
|
|
|
If using the external WebCam, make sure "cap = cv2.VideoCapture(1)" (at line 17).
|
|
|
|
3. Run "Facial_Recognition_Registration.py"
|
|
|
|
4. Enter the label as your name.
|
2020-11-08 22:32:13 +00:00
|
|
|
|
|
|
|
Your face dataset:
|
2021-01-24 00:04:25 +00:00
|
|
|
1. Folder "/Facial_images" -> "/face_rec" -> "/train", then you can see the folder of your name is in it.
|
2020-11-08 22:32:13 +00:00
|
|
|
|
2021-01-24 00:04:25 +00:00
|
|
|
|
|
|
|
b. Test on videostream
|
2021-01-19 21:33:38 +00:00
|
|
|
1. In "Facial_Recognition_Inference.py".
|
|
|
|
2. Make sure line 27 to match your imaging device, same as above a.2
|
|
|
|
3. Run
|
|
|
|
|
|
|
|
|
|
|
|
3. Requirements for face registration:
|
2021-01-24 00:00:51 +00:00
|
|
|
a. User can sometimes slightly rotate their face, but must make sure their facical features (mouth, eyes, nose...) are within the camera view.
|
|
|
|
b. Ambient light could affect the performance of the facial detection, such as overexposure, glare, reflection or so on;
|
2020-11-08 22:32:13 +00:00
|
|
|
|
|
|
|
welcome any try-out and comments!
|