Fix Image duplication when no faces detected
This commit is contained in:
@@ -26,6 +26,10 @@ try:
|
|||||||
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
||||||
faces, rejects, weights = face_cascade.detectMultiScale3(gray, 1.1, 4, outputRejectLevels = 1)
|
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
|
i = 0
|
||||||
for (x, y, w, h) in faces:
|
for (x, y, w, h) in faces:
|
||||||
confidence = float(weights[i])
|
confidence = float(weights[i])
|
||||||
|
|||||||
Reference in New Issue
Block a user