Skip to content

Commit

Permalink
continue if face recognition did not find face
Browse files Browse the repository at this point in the history
  • Loading branch information
kex0 committed Jul 2, 2023
1 parent ed8b334 commit 872f2cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roop/processors/frame/face_swapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def process_recognition(temp_frame_paths: List[str]) -> dict:
face_locations = sorted(face_locations, key=lambda x: x[1])
face_encodings = face_recognition.face_encodings(temp_frame, face_locations)

if len(face_encodings) == 0:
matches_dict[temp_frame_path] = None
for i, face_encoding in enumerate(face_encodings):
matches = face_recognition.compare_faces([reference_encoding], face_encoding)
if True in matches:
Expand Down

0 comments on commit 872f2cf

Please sign in to comment.