Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,9 +50,9 @@ def capture_function(vid=None,frame_count=None):
|
|
50 |
capture.set(cv2.CAP_PROP_POS_FRAMES, i)
|
51 |
ret, frame_f = capture.read(i)
|
52 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
|
|
|
|
53 |
|
54 |
-
fbox.append(frame_ff)
|
55 |
-
|
56 |
capture.set(cv2.CAP_PROP_POS_FRAMES, int(frame_count)-1)
|
57 |
ret, frame_f = capture.read()
|
58 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
@@ -66,6 +66,7 @@ def rem_bg(inp):
|
|
66 |
ret, frame = cap.read()
|
67 |
|
68 |
out = rem_bg()
|
|
|
69 |
|
70 |
|
71 |
|
|
|
50 |
capture.set(cv2.CAP_PROP_POS_FRAMES, i)
|
51 |
ret, frame_f = capture.read(i)
|
52 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
53 |
+
im_file = cv2.imwrite(f'{uid}-{i}.png')
|
54 |
+
fbox.append(f'{uid}-{i}.png')
|
55 |
|
|
|
|
|
56 |
capture.set(cv2.CAP_PROP_POS_FRAMES, int(frame_count)-1)
|
57 |
ret, frame_f = capture.read()
|
58 |
frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
|
|
|
66 |
ret, frame = cap.read()
|
67 |
|
68 |
out = rem_bg()
|
69 |
+
out = cv2.VideoWriter('video.avi',cv2.VideoWriter_fourcc(*'DIVX'), 15, size)
|
70 |
|
71 |
|
72 |
|