Merge pull request #84 from balazik/fix-face-selection

Fixed face selection by removing reverse=True in apply_pulid function
This commit is contained in:
Matteo Spinelli
2024-10-05 18:21:01 +02:00
committed by GitHub
+1 -1
View File
@@ -354,7 +354,7 @@ class ApplyPulid:
face_analysis.det_model.input_size = size
face = face_analysis.get(image[i])
if face:
face = sorted(face, key=lambda x: (x.bbox[2] - x.bbox[0]) * (x.bbox[3] - x.bbox[1]), reverse=True)[-1]
face = sorted(face, key=lambda x: (x.bbox[2] - x.bbox[0]) * (x.bbox[3] - x.bbox[1]))[-1]
iface_embeds = torch.from_numpy(face.embedding).unsqueeze(0).to(device, dtype=dtype)
break
else: