Spaces:
Sleeping
Sleeping
Commit
•
e0cc1fd
1
Parent(s):
a765444
Update app.py
Browse files
app.py
CHANGED
@@ -44,12 +44,12 @@ def tog_off():
|
|
44 |
def pl_fn(cap,cur,last,fps,pl_tog):
|
45 |
player.set(cv2.CAP_PROP_POS_FRAMES, cur)
|
46 |
ret, frame_bgr = player.read(cur)
|
47 |
-
|
48 |
-
frame = Image.fromarray(
|
49 |
output = segmentor(frame)
|
50 |
for i in range(len(output)):
|
51 |
mask = np.array(output[i]['mask'])/255
|
52 |
-
img = np.array(
|
53 |
img2 = np.zeros_like(img)
|
54 |
img2[:,:,0] = mask
|
55 |
img2[:,:,1] = mask
|
|
|
44 |
def pl_fn(cap,cur,last,fps,pl_tog):
|
45 |
player.set(cv2.CAP_PROP_POS_FRAMES, cur)
|
46 |
ret, frame_bgr = player.read(cur)
|
47 |
+
frame = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2RGB)
|
48 |
+
frame = Image.fromarray(frame)
|
49 |
output = segmentor(frame)
|
50 |
for i in range(len(output)):
|
51 |
mask = np.array(output[i]['mask'])/255
|
52 |
+
img = np.array(frame)
|
53 |
img2 = np.zeros_like(img)
|
54 |
img2[:,:,0] = mask
|
55 |
img2[:,:,1] = mask
|