Don't add duplicates

This commit is contained in:
Antonio J. Delgado 2021-09-06 17:13:28 +03:00
parent 809337c5eb
commit cb4ca96251

View file

@ -130,7 +130,8 @@ class image_classifier:
for known_person in self.known_people:
for encoding in encodings:
if face_recognition.compare_faces([known_person['encoding']], encoding)[0]:
people.append(known_person['name'])
if known_person['name'] not in people:
people.append(known_person['name'])
except PIL.UnidentifiedImageError as error:
self._log.debug(f"File '{file}' don't seem to be an image.")
return False