oguzakif commited on
Commit
1b827ab
1 Parent(s): 6e61d6f

video writer fixed

Browse files
Files changed (1) hide show
  1. app.py +2 -4
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
- video_writer.write(frame)
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()