Spaces:
Sleeping
Sleeping
mask_list video writing removed, polyline on tracked video removed
Browse files
app.py
CHANGED
@@ -157,8 +157,6 @@ def track_and_mask(vid, original_frame, masked_frame):
|
|
157 |
# can't write out mp4, so try to write into an AVI file
|
158 |
video_writer = cv2.VideoWriter(
|
159 |
"output.avi", cv2.VideoWriter_fourcc(*'MP42'), fps, (width, height))
|
160 |
-
video_writer2 = cv2.VideoWriter(
|
161 |
-
"output_mask.avi", cv2.VideoWriter_fourcc(*'MP42'), fps, (width, height))
|
162 |
|
163 |
while video_capture.isOpened():
|
164 |
ret, frame = video_capture.read()
|
@@ -187,16 +185,14 @@ def track_and_mask(vid, original_frame, masked_frame):
|
|
187 |
mask = mask.astype(np.uint8) # convert to an unsigned byte
|
188 |
mask = mask * 255
|
189 |
mask_list.append(mask)
|
190 |
-
cv2.polylines(frame, [np.int0(location).reshape(
|
191 |
-
|
192 |
|
193 |
video_writer.write(frame)
|
194 |
-
video_writer2.write(mask)
|
195 |
f = f + 1
|
196 |
|
197 |
video_capture.release()
|
198 |
video_writer.release()
|
199 |
-
video_writer2.release()
|
200 |
|
201 |
else:
|
202 |
print("can't open the given input video file!")
|
|
|
157 |
# can't write out mp4, so try to write into an AVI file
|
158 |
video_writer = cv2.VideoWriter(
|
159 |
"output.avi", cv2.VideoWriter_fourcc(*'MP42'), fps, (width, height))
|
|
|
|
|
160 |
|
161 |
while video_capture.isOpened():
|
162 |
ret, frame = video_capture.read()
|
|
|
185 |
mask = mask.astype(np.uint8) # convert to an unsigned byte
|
186 |
mask = mask * 255
|
187 |
mask_list.append(mask)
|
188 |
+
#cv2.polylines(frame, [np.int0(location).reshape(
|
189 |
+
# (-1, 1, 2))], True, (0, 255, 0), 3)
|
190 |
|
191 |
video_writer.write(frame)
|
|
|
192 |
f = f + 1
|
193 |
|
194 |
video_capture.release()
|
195 |
video_writer.release()
|
|
|
196 |
|
197 |
else:
|
198 |
print("can't open the given input video file!")
|