amirgame197 commited on
Commit
4ae29be
·
verified ·
1 Parent(s): 7f27117

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -6,7 +6,7 @@ def blur_image(image_path, detections, parts_to_blur):
6
  image = cv2.imread(image_path)
7
 
8
  for detection in detections:
9
- label = detection['label']
10
  if label in parts_to_blur:
11
  x1, y1, x2, y2 = map(int, detection['box'])
12
  roi = image[y1:y2, x1:x2]
@@ -22,8 +22,9 @@ def process(input_img):
22
  detections = detector.detect(input_img)
23
  print(detections)
24
  parts_to_blur = [
25
- 'EXPOSED_GENITALIA_F', 'EXPOSED_GENITALIA_M',
26
- 'EXPOSED_BREAST_F', 'EXPOSED_BUTTOCKS_F', 'EXPOSED_BUTTOCKS_M'
 
27
  ]
28
 
29
  blurred_image_path = blur_image(input_img, detections, parts_to_blur)
 
6
  image = cv2.imread(image_path)
7
 
8
  for detection in detections:
9
+ label = detection['class']
10
  if label in parts_to_blur:
11
  x1, y1, x2, y2 = map(int, detection['box'])
12
  roi = image[y1:y2, x1:x2]
 
22
  detections = detector.detect(input_img)
23
  print(detections)
24
  parts_to_blur = [
25
+ 'FEMALE_GENITALIA_EXPOSED', 'MALE_GENITALIA_EXPOSED',
26
+ 'FEMALE_BREAST_EXPOSED', 'BUTTOCKS_EXPOSED',
27
+ 'MALE_BREAST_EXPOSED', 'ANUS_EXPOSED'
28
  ]
29
 
30
  blurred_image_path = blur_image(input_img, detections, parts_to_blur)