Update app.py
Browse files
app.py
CHANGED
@@ -176,6 +176,7 @@ def remove_bg(fl, count):
|
|
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).astype(np.uint8)
|
|
|
179 |
|
180 |
m = cv2.inRange(fr, np.array([240,240,240]), np.array([255,255,255]))
|
181 |
fr[m>0] = (239,239,239)
|
|
|
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).astype(np.uint8)
|
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)
|