ageitgey / face_recognition

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

IndexError: list index out of range #1455

Open NiceboyWiseboy opened 1 year ago

NiceboyWiseboy commented 1 year ago

Hello,

Description

I'm trying to compare a single face from webcam with list of face encodings and it just shows:

Traceback (most recent call last):
  File "/home/uac/Documents/PyCharmProjects/face_compare/scripts/main.py", line 94, in <module>
    name = known_face_names[best_match_index]
IndexError: list index out of range

What I Did

Just ran the script and detected a face from the webcam.

please help as I'm stuck here since a week. thanks for the help in advance.

Morgandri1 commented 1 year ago

have you tried printing known_face_names and best_match_index to make sure you're not looking for something that isn't there?