This commit is contained in:
JonatanRek
2024-10-05 23:16:33 +02:00
parent c5bce29178
commit 74dbc8163a
+2 -1
View File
@@ -42,13 +42,14 @@ try:
for (x, y, w, h) in faces: for (x, y, w, h) in faces:
confidence = float(weights[i]) confidence = float(weights[i])
print(str(confidence) + " Faces Confidence" , flush=True) print(str(confidence) + " Faces Confidence" , flush=True)
if (confidence > treashold): if (confidence > treashold):
face_roi = img[y:y+h, x:x+w] face_roi = img[y:y+h, x:x+w]
blurred_face = cv2.GaussianBlur(face_roi, (99, 99), 50) blurred_face = cv2.GaussianBlur(face_roi, (99, 99), 50)
img[y:y+h, x:x+w] = blurred_face img[y:y+h, x:x+w] = blurred_face
print("Faces Anonymized" , flush=True) print("Faces Anonymized" , flush=True)
text = "{}".format(weights[i]) text = "{}".format(weights[i])
#cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2) cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)
#cv2.putText(img, text, (x, y), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (0, 0, 255), 2) #cv2.putText(img, text, (x, y), cv2.FONT_HERSHEY_SIMPLEX, 0.45, (0, 0, 255), 2)
i = i +1 i = i +1