mmkuznecov commited on
Commit
405c26e
·
1 Parent(s): 40274f6

fixed a bug

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -11,15 +11,16 @@ def detect_and_blur_faces(image):
11
 
12
  output_image = image.copy()
13
 
 
14
 
15
- for i in range(len(resp)):
16
 
17
- [x, y, w, h] = resp[f'face_{i+1}']['facial_area']
18
 
19
- # Blur the detected face.
20
- face = output_image[y:h, x:w]
21
- blurred_face = cv2.GaussianBlur(face, (99, 99), 30)
22
- output_image[y:h, x:w] = blurred_face
23
 
24
  return output_image
25
 
 
11
 
12
  output_image = image.copy()
13
 
14
+ if 'face_1' in resp:
15
 
16
+ for i in range(len(resp)):
17
 
18
+ [x, y, w, h] = resp[f'face_{i+1}']['facial_area']
19
 
20
+ # Blur the detected face.
21
+ face = output_image[y:h, x:w]
22
+ blurred_face = cv2.GaussianBlur(face, (99, 99), 30)
23
+ output_image[y:h, x:w] = blurred_face
24
 
25
  return output_image
26