ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.35k stars 13.36k forks source link

using folder of faces for live recog #1113

Open Azza71 opened 4 years ago

Azza71 commented 4 years ago

Python 2.7.12 + Linux Ubuntu 16.04

I am using the live recognition found in https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_webcam_faster.py I would like to know if there is a way where I can either automate the process of adding the faces instead of manually coding them in, or if I can use a folder of images? This is because I want to allow the user to add faces to the folder (database of known people) without coding them in.

Latestion commented 4 years ago

@Azza71 Do u mean you have multiple images in a folder? If that's the case you can do the following... https://paste.ofcode.org/sXqGQA4F5Wx49LWRzbE9YC

Azza71 commented 4 years ago

@Latestion I tried your code and added it to my code, but it doesn't let me use the folder. This is the error in the terminal... IOError: [Errno 21] Is a directory: '/home/mxhra/FacialRecognition_Database' This is the code... https://paste.ofcode.org/vHH3RspHVeBJTgFQhdKtfE

Latestion commented 4 years ago

@Azza71 Does this

KNOWN_FACES_DIR = "/home/mxhra/FacialRecognition_Database" Directory exists?

Azza71 commented 4 years ago

@Latestion Yes it does and it has pictures inside it