From d509db79d19d2f9d0b724f448b6791b814cad8b9 Mon Sep 17 00:00:00 2001 From: hzwer <598460606@163.com> Date: Tue, 17 Nov 2020 23:21:35 +0800 Subject: [PATCH] Fix bug --- inference_mp4_4x_parallel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inference_mp4_4x_parallel.py b/inference_mp4_4x_parallel.py index 9b43178..80cc779 100644 --- a/inference_mp4_4x_parallel.py +++ b/inference_mp4_4x_parallel.py @@ -76,7 +76,7 @@ while success: success, frame = videoCapture.read() if success: img_list.append(frame) - if len(img_list) == 5 or not success: + if len(img_list) == 5 or (not success and len(img_list) > 1): I0 = torch.from_numpy(np.transpose(img_list[:-1], (0, 3, 1, 2)).astype("float32") / 255.).to(device) I1 = torch.from_numpy(np.transpose(img_list[1:], (0, 3, 1, 2)).astype("float32") / 255.).to(device) p = (F.interpolate(I0, (16, 16), mode='bilinear', align_corners=False)