From a7eb43f89a10d51acddb68d0eb17592b4a7a8692 Mon Sep 17 00:00:00 2001 From: David Chatel Date: Sun, 10 Mar 2024 18:37:36 +0100 Subject: [PATCH] fix bug when no face detected --- utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/utils.py b/utils.py index 6dc996f..443abda 100644 --- a/utils.py +++ b/utils.py @@ -94,7 +94,6 @@ class Face: def detect_faces(img, threshold): dets = Models.yolo((img[None] / 255).permute(0,3,1,2), threshold) boxes = (dets.boxes.xyxy.reshape(-1,2,2)).reshape(-1,4) - a,b,c,d = [int(x) for x in boxes[0]] faces = [] for (a,b,c,d), box in zip(boxes.type(torch.int).cpu().numpy(), dets.boxes): cx, cy = (a+c)/2, (b+d)/2