mirror of
https://github.com/hzwer/ECCV2022-RIFE.git
synced 2026-02-24 04:19:41 +01:00
More robust video file path getter
This commit is contained in:
@@ -36,7 +36,8 @@ if args.png:
|
||||
if not os.path.exists('output'):
|
||||
os.mkdir('output')
|
||||
else:
|
||||
output = cv2.VideoWriter('{}_2x.{}'.format(args.video[:-4], args.ext), fourcc, args.fps, (w, h))
|
||||
video_path_wo_ext, ext = os.path.splitext(args.video)
|
||||
output = cv2.VideoWriter('{}_2x.{}'.format(video_path_wo_ext, args.ext), fourcc, args.fps, (w, h))
|
||||
|
||||
cnt = 0
|
||||
def writeframe(frame):
|
||||
@@ -54,7 +55,7 @@ ph = ((h - 1) // 32 + 1) * 32
|
||||
pw = ((w - 1) // 32 + 1) * 32
|
||||
padding = (0, pw - w, 0, ph - h)
|
||||
tot_frame = videoCapture.get(cv2.CAP_PROP_FRAME_COUNT)
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(args.video[:-4], args.ext, tot_frame, fps, args.fps))
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(video_path_wo_ext, args.ext, tot_frame, fps, args.fps))
|
||||
pbar = tqdm(total=tot_frame)
|
||||
skip_frame = 1
|
||||
if args.montage:
|
||||
|
||||
@@ -36,7 +36,8 @@ if args.png:
|
||||
if not os.path.exists('output'):
|
||||
os.mkdir('output')
|
||||
else:
|
||||
output = cv2.VideoWriter('{}_4x.{}'.format(args.video[:-4], args.ext), fourcc, args.fps, (w, h))
|
||||
video_path_wo_ext, ext = os.path.splitext(args.video)
|
||||
output = cv2.VideoWriter('{}_4x.{}'.format(video_path_wo_ext, args.ext), fourcc, args.fps, (w, h))
|
||||
|
||||
cnt = 0
|
||||
def writeframe(frame):
|
||||
@@ -53,7 +54,7 @@ ph = ((h - 1) // 32 + 1) * 32
|
||||
pw = ((w - 1) // 32 + 1) * 32
|
||||
padding = (0, pw - w, 0, ph - h)
|
||||
tot_frame = videoCapture.get(cv2.CAP_PROP_FRAME_COUNT)
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(args.video[:-4], args.ext, tot_frame, fps, args.fps))
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(video_path_wo_ext, args.ext, tot_frame, fps, args.fps))
|
||||
pbar = tqdm(total=tot_frame)
|
||||
skip_frame = 1
|
||||
if args.montage:
|
||||
|
||||
@@ -35,7 +35,8 @@ if args.png:
|
||||
if not os.path.exists('output'):
|
||||
os.mkdir('output')
|
||||
else:
|
||||
output = cv2.VideoWriter('{}_4x.{}'.format(args.video[:-4], args.ext), fourcc, args.fps, (w, h))
|
||||
video_path_wo_ext, ext = os.path.splitext(args.video)
|
||||
output = cv2.VideoWriter('{}_4x.{}'.format(video_path_wo_ext, args.ext), fourcc, args.fps, (w, h))
|
||||
|
||||
cnt = 0
|
||||
skip_frame = 1
|
||||
@@ -71,7 +72,7 @@ ph = ((h - 1) // 32 + 1) * 32
|
||||
pw = ((w - 1) // 32 + 1) * 32
|
||||
padding = (0, pw - w, 0, ph - h)
|
||||
tot_frame = videoCapture.get(cv2.CAP_PROP_FRAME_COUNT)
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(args.video[:-4], args.ext, tot_frame, fps, args.fps))
|
||||
print('{}.{}, {} frames in total, {}FPS to {}FPS'.format(video_path_wo_ext, args.ext, tot_frame, fps, args.fps))
|
||||
pbar = tqdm(total=tot_frame)
|
||||
img_list = [frame]
|
||||
while success:
|
||||
|
||||
Reference in New Issue
Block a user