Here we will learn to use "dlib" library to train as well as recognize the face
-
install dlib
- windows
- must have python 3.6
- visit here to get the link of dlib which suits your system
- right click on the link highlighted in green and copy link address
- activate your python virtual environment
- run the command
python -m pip install <pypi-link>
where pypi-link is the link address you copied
- windows
-
running the code
- add your picture (only one needed) in the id folder and name it as your-name_id
- _ (underscore) matters here in between your-name and id
- example: in my case deepak_1
- if you want to train more than one then add their photo in id folder and name them as following examples:
- name_1
- name_2
- name_3
- and so on...
- when you are done with adding the photos in id folder just run the following command to TRAIN(encode) with the photos
python encoding.py
- this will create a encodings.pickle file which contains the 128-facial features
- human can't read that pickle file
- the last step i.e. DETECTION run the command given below in your terminal
python detect.py
- add your picture (only one needed) in the id folder and name it as your-name_id
-
thats it for the begineer level