Fix parallel

This commit is contained in:
hzwer
2020-11-20 14:37:54 +08:00
parent 2097ef5e25
commit dcf8fa9810

View File

@@ -104,7 +104,7 @@ while success:
success, frame = videoCapture.read()
if success:
img_list.append(frame)
if len(img_list) == 3 or (not success and len(img_list) > 1):
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, non_blocking=True)
I1 = torch.from_numpy(np.transpose(img_list[1:], (0, 3, 1, 2)).astype('float32') / 255.).to(device, non_blocking=True)
p = (F.interpolate(I0, (16, 16), mode='bilinear', align_corners=False)