Spaces:
Running on Zero
Running on Zero
Bug fix: video write failure on $pred_only == True
Browse filesBug: $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.
58 unmodified lines59606162636458 unmodified linesframe_rate = int(raw_video.get(cv2.CAP_PROP_FPS))output_width = frame_width * 2 + margin_widthoutput_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))58 unmodified lines596061626364656667686958 unmodified linesframe_rate = int(raw_video.get(cv2.CAP_PROP_FPS))output_width = frame_width * 2 + margin_widthif args.pred_only:output_width = frame_widthelse:output_width = frame_width * 2 + margin_widthoutput_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
run_video.py+5