matthewfarant commited on
Commit
80c3ca8
1 Parent(s): 556a859

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -141,8 +141,12 @@ def process_image():
141
 
142
  # Blur the corresponding region in group photo
143
  img_obstruct = cv2.imread(group_photo_path + image)
144
- img_obstruct[y:y+h, x:x+w] = cv2.blur(img_obstruct[y:y+h, x:x+w], (50, 50))
145
- img_obstruct = cv2.cvtColor(img_obstruct, cv2.COLOR_BGR2RGB)
 
 
 
 
146
 
147
  # Delete all photos in reference and testing folder after processing
148
  shutil.rmtree('reference', ignore_errors=True)
 
141
 
142
  # Blur the corresponding region in group photo
143
  img_obstruct = cv2.imread(group_photo_path + image)
144
+
145
+ if max_avg_similarity_idx >= 0.3:
146
+ img_obstruct[y:y+h, x:x+w] = cv2.blur(img_obstruct[y:y+h, x:x+w], (50, 50))
147
+ img_obstruct = cv2.cvtColor(img_obstruct, cv2.COLOR_BGR2RGB)
148
+ else:
149
+ img_obstruct = cv2.cvtColor(img_obstruct, cv2.COLOR_BGR2RGB)
150
 
151
  # Delete all photos in reference and testing folder after processing
152
  shutil.rmtree('reference', ignore_errors=True)