freealise commited on
Commit
15af9cc
·
verified ·
1 Parent(s): dbfd0ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -174,9 +174,8 @@ def remove_bg(fl, count):
174
  fr_diff = cv2.dilate(cv2.erode(fr_diff, element), element)
175
 
176
  if count % 2: # odd: is photo without the flash
177
- fr_mask = cv2.imread(fl_).astype(np.uint8)
178
- fr_mask = fr_diff - cv2.cvtColor(fr_mask, cv2.COLOR_BGR2GRAY)
179
- cv2.imwrite(fl_, fr_mask)
180
 
181
  m = cv2.inRange(fr, np.array([240,240,240]), np.array([255,255,255]))
182
  fr[m>0] = (239,239,239)
 
174
  fr_diff = cv2.dilate(cv2.erode(fr_diff, element), element)
175
 
176
  if count % 2: # odd: is photo without the flash
177
+ fr_mask = cv2.cvtColor(cv2.imread(fl_).astype(np.uint8), cv2.COLOR_BGR2GRAY)
178
+ fr_mask = fr_diff - fr_mask
 
179
 
180
  m = cv2.inRange(fr, np.array([240,240,240]), np.array([255,255,255]))
181
  fr[m>0] = (239,239,239)