danpanfili commited on
Commit
a1546ae
1 Parent(s): 187c6c8

Bug fix: video write failure on $pred_only == True

Browse files

Bug: $pred_only output failed to write to video file.
Cause: $output_width always set to double width plus margin, despite $pred_only output being $frame_width sized.
Fix: Conditional check for $pred_only before setting $output_width.

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