LiheYoung danpanfili commited on
Commit
0811d77
1 Parent(s): 187c6c8

Bug fix: video write failure on $pred_only == True (#4)

Browse files

- Bug fix: video write failure on $pred_only == True (a1546aee4023ac3fbde9d69ac11b6094e8d57764)


Co-authored-by: Daniel Panfili <danpanfili@users.noreply.huggingface.co>

Files changed (1) hide show
  1. run_video.py +5 -0
run_video.py CHANGED
@@ -59,6 +59,11 @@ if __name__ == '__main__':
59
  frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
60
  output_width = frame_width * 2 + margin_width
61
 
 
 
 
 
 
62
  output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')
63
  out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
64
 
 
59
  frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
60
  output_width = frame_width * 2 + margin_width
61
 
62
+ if args.pred_only:
63
+ output_width = frame_width
64
+ else:
65
+ output_width = frame_width * 2 + margin_width
66
+
67
  output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')
68
  out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
69