Update app.py
Browse files
app.py
CHANGED
|
@@ -137,8 +137,8 @@ def infer(f_in, interpolation, fps_output):
|
|
| 137 |
return final_vid, files
|
| 138 |
|
| 139 |
|
| 140 |
-
def remove_bg(
|
| 141 |
-
frame = cv2.imread(
|
| 142 |
|
| 143 |
b = 5
|
| 144 |
#subtract background (get scene with shadow) and correct hue against light
|
|
@@ -180,7 +180,9 @@ def remove_bg(fr):
|
|
| 180 |
frame_[mask>0] = (125,125,125)
|
| 181 |
frame_[frame_[:,:,0]>=142] = (255,255,255)
|
| 182 |
|
| 183 |
-
|
|
|
|
|
|
|
| 184 |
|
| 185 |
def logscale(linear):
|
| 186 |
return int(math.pow(2, linear))
|
|
|
|
| 137 |
return final_vid, files
|
| 138 |
|
| 139 |
|
| 140 |
+
def remove_bg(fl):
|
| 141 |
+
frame = cv2.imread(fl).astype(np.uint8)
|
| 142 |
|
| 143 |
b = 5
|
| 144 |
#subtract background (get scene with shadow) and correct hue against light
|
|
|
|
| 180 |
frame_[mask>0] = (125,125,125)
|
| 181 |
frame_[frame_[:,:,0]>=142] = (255,255,255)
|
| 182 |
|
| 183 |
+
cv2.imwrite(fl, frame) #frame_
|
| 184 |
+
|
| 185 |
+
return fl
|
| 186 |
|
| 187 |
def logscale(linear):
|
| 188 |
return int(math.pow(2, linear))
|