From 61a48ef61c182e2e61c88f7570cb90429fab6eff Mon Sep 17 00:00:00 2001 From: hzwer <598460606@163.com> Date: Mon, 16 Nov 2020 17:37:50 +0800 Subject: [PATCH] Fix bugs --- inference_mp4_2x.py | 5 ++--- inference_mp4_4x.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inference_mp4_2x.py b/inference_mp4_2x.py index a759da6..8b50115 100644 --- a/inference_mp4_2x.py +++ b/inference_mp4_2x.py @@ -60,7 +60,8 @@ while success: p = (F.interpolate(I0, (16, 16), mode='bilinear', align_corners=False) - F.interpolate(I1, (16, 16), mode='bilinear', align_corners=False)).abs().mean() if p < 1e-3 and args.skip: - print("Warning: Your video has {} static frames, skipping them change the duration of the generated video.".format(cnt)) + if cnt % 10 == 0: + print("Warning: Your video has {} static frames, skipping them change the duration of the generated video.".format(cnt)) cnt += 1 pbar.update(1) continue @@ -74,9 +75,7 @@ while success: output.write(np.concatenate((lastframe, mid1[:h, :w]), 1)) else: output.write(lastframe) - output.write(mid0[:h, :w]) output.write(mid1[:h, :w]) - output.write(mid2[:h, :w]) pbar.update(1) if args.montage: output.write(np.concatenate((lastframe, lastframe), 1)) diff --git a/inference_mp4_4x.py b/inference_mp4_4x.py index cead491..7dfbd09 100644 --- a/inference_mp4_4x.py +++ b/inference_mp4_4x.py @@ -60,7 +60,8 @@ while success: p = (F.interpolate(I0, (16, 16), mode='bilinear', align_corners=False) - F.interpolate(I1, (16, 16), mode='bilinear', align_corners=False)).abs().mean() if p < 1e-3 and args.skip: - print("Warning: Your video has {} static frames, skipping them may change the duration of the generated video.".format(cnt)) + if cnt % 10 == 0: + print("Warning: Your video has {} static frames, skipping them may change the duration of the generated video.".format(cnt)) cnt += 1 pbar.update(1) continue