From 5db0b9117f728a19b989953e1da29cfa6209c377 Mon Sep 17 00:00:00 2001 From: hzwer <598460606@163.com> Date: Sun, 15 Nov 2020 23:08:08 +0800 Subject: [PATCH] Fix lastframe --- inference_mp4_2x.py | 4 ++-- inference_mp4_4x.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inference_mp4_2x.py b/inference_mp4_2x.py index 01a0b68..bfe7fda 100644 --- a/inference_mp4_2x.py +++ b/inference_mp4_2x.py @@ -48,9 +48,9 @@ if args.montage: while success: lastframe = frame success, frame = videoCapture.read() - if args.montage: - frame = frame[:, left: left + w] if success: + if args.montage: + frame = frame[:, left: left + w]if args.montage: I0 = torch.from_numpy(np.transpose(lastframe, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0) I1 = torch.from_numpy(np.transpose(frame, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0) I0 = F.pad(I0, padding) diff --git a/inference_mp4_4x.py b/inference_mp4_4x.py index f1b2624..20dd593 100644 --- a/inference_mp4_4x.py +++ b/inference_mp4_4x.py @@ -48,9 +48,9 @@ if args.montage: while success: lastframe = frame success, frame = videoCapture.read() - if args.montage: - frame = frame[:, left: left + w] if success: + if args.montage: + frame = frame[:, left: left + w] I0 = torch.from_numpy(np.transpose(lastframe, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0) I1 = torch.from_numpy(np.transpose(frame, (2,0,1)).astype("float32") / 255.).to(device).unsqueeze(0) I0 = F.pad(I0, padding)