Spaces:
Running
on
T4
Running
on
T4
video writer fixed
Browse files
app.py
CHANGED
@@ -163,8 +163,6 @@ def track_and_mask(vid, masked_frame, original_list, mask_list, in_fps, dt_strin
|
|
163 |
state = siamese_init(
|
164 |
frame, target_pos, target_sz, siammask, cfg['hp'], device=device)
|
165 |
original_list.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
166 |
-
frame[:, :, 2] = (masked_frame == 255) + \
|
167 |
-
(masked_frame == 0) * frame[:, :, 2]
|
168 |
else:
|
169 |
# track
|
170 |
state = siamese_track(
|
@@ -177,8 +175,8 @@ def track_and_mask(vid, masked_frame, original_list, mask_list, in_fps, dt_strin
|
|
177 |
mask = mask.astype(np.uint8) # convert to an unsigned byte
|
178 |
mask = mask * 255
|
179 |
mask_list.append(mask)
|
180 |
-
|
181 |
-
|
182 |
f = f + 1
|
183 |
|
184 |
video_capture.release()
|
|
|
163 |
state = siamese_init(
|
164 |
frame, target_pos, target_sz, siammask, cfg['hp'], device=device)
|
165 |
original_list.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
|
|
|
|
166 |
else:
|
167 |
# track
|
168 |
state = siamese_track(
|
|
|
175 |
mask = mask.astype(np.uint8) # convert to an unsigned byte
|
176 |
mask = mask * 255
|
177 |
mask_list.append(mask)
|
178 |
+
video_writer.write(frame)
|
179 |
+
|
180 |
f = f + 1
|
181 |
|
182 |
video_capture.release()
|