Fix Image duplication when no faces detected

This commit is contained in:
JonatanRek
2024-10-02 19:45:10 +02:00
parent 432c2374af
commit 38d4617b28
+4
View File
@@ -26,6 +26,10 @@ try:
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces, rejects, weights = face_cascade.detectMultiScale3(gray, 1.1, 4, outputRejectLevels = 1)
#Count faces is null dont anonimize file
if (len(faces) < 0):
continue
i = 0
for (x, y, w, h) in faces:
confidence = float(weights[i])