Skip to content

Commit f22de19

Browse files
authored
Fixed reduced duration of output video bug + scale passed as timestep bug. (#96)
* Update inference_video.py * Update inference_video.py * Fixed scale passed as timestep bug
1 parent 6cd650c commit f22de19

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

inference_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def transferAudio(sourceVideo, targetVideo):
108108
videoCapture.release()
109109
if args.fps is None:
110110
fpsNotAssigned = True
111-
args.fps = fps * args.multi
111+
args.fps = fps * (args.multi - 1)
112112
else:
113113
fpsNotAssigned = False
114114
videogen = skvideo.io.vreader(args.video)
@@ -234,7 +234,7 @@ def pad_image(img):
234234
temp = frame
235235
I1 = torch.from_numpy(np.transpose(frame, (2,0,1))).to(device, non_blocking=True).unsqueeze(0).float() / 255.
236236
I1 = pad_image(I1)
237-
I1 = model.inference(I0, I1, args.scale)
237+
I1 = model.inference(I0, I1, scale=args.scale)
238238
I1_small = F.interpolate(I1, (32, 32), mode='bilinear', align_corners=False)
239239
ssim = ssim_matlab(I0_small[:, :3], I1_small[:, :3])
240240
frame = (I1[0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w]
@@ -253,7 +253,7 @@ def pad_image(img):
253253
output.append(torch.from_numpy(np.transpose((cv2.addWeighted(frame[:, :, ::-1], alpha, lastframe[:, :, ::-1], beta, 0)[:, :, ::-1].copy()), (2,0,1))).to(device, non_blocking=True).unsqueeze(0).float() / 255.)
254254
'''
255255
else:
256-
output = make_inference(I0, I1, args.multi-1)
256+
output = make_inference(I0, I1, args.multi - 1)
257257

258258
if args.montage:
259259
write_buffer.put(np.concatenate((lastframe, lastframe), 1))

0 commit comments

Comments
 (0)