jamct / facerec

Face recognition for Raspberry Pi
3 stars 4 forks source link

error while running beispiel.py #4

Open wettermann32 opened 6 years ago

wettermann32 commented 6 years ago

root@ade6bb52e746:/face_recognition/examples# python beispiel.py Bilder werden geladen Traceback (most recent call last): File "beispiel.py", line 28, in load_face_encoding("Angela Merkel", os.path.dirname(os.path.abspath(file))+"/bilder/person1.jpg") File "beispiel.py", line 15, in load_face_encoding face_encoding = face_recognition.face_encodings(image)[0] IndexError: list index out of range root@ade6bb52e746:/face_recognition/examples#

jamct commented 6 years ago

Did you change directory to "facerec" before running "docker run"? Is there a "person1.jpg" in "bilder"?

smxsm commented 5 years ago

If the paths are correct, the problem is probably that there is a problem with one of the images (e.g. no face is recognized) and the script does not handle that case and causes an error - see https://github.com/ageitgey/face_recognition/wiki/Common-Errors As a fix, try e.g. https://github.com/smxsm/facerec/blob/master/scripts/beispiel.py#L15-L17