mirror of
https://github.com/hzwer/ECCV2022-RIFE.git
synced 2025-12-24 04:09:30 +01:00
Update inference_video.py
This commit is contained in:
@@ -223,7 +223,11 @@ while True:
|
|||||||
pbar.update(1)
|
pbar.update(1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if ssim < 0.5:
|
if ssim < 0.2:
|
||||||
|
output = []
|
||||||
|
for i in range((2 ** args.exp) - 1):
|
||||||
|
output.append(I0)
|
||||||
|
'''
|
||||||
output = []
|
output = []
|
||||||
step = 1 / (2 ** args.exp)
|
step = 1 / (2 ** args.exp)
|
||||||
alpha = 0
|
alpha = 0
|
||||||
@@ -231,6 +235,7 @@ while True:
|
|||||||
alpha += step
|
alpha += step
|
||||||
beta = 1-alpha
|
beta = 1-alpha
|
||||||
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.)
|
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.)
|
||||||
|
'''
|
||||||
else:
|
else:
|
||||||
output = make_inference(I0, I1, 2**args.exp-1) if args.exp else []
|
output = make_inference(I0, I1, 2**args.exp-1) if args.exp else []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user