Update inference_video.py

This commit is contained in:
hzwer
2021-06-17 14:10:44 +08:00
committed by GitHub
parent b02b6aaa4c
commit 618ddb30e6

View File

@@ -223,7 +223,11 @@ while True:
pbar.update(1)
continue
if ssim < 0.5:
if ssim < 0.2:
output = []
for i in range((2 ** args.exp) - 1):
output.append(I0)
'''
output = []
step = 1 / (2 ** args.exp)
alpha = 0
@@ -231,6 +235,7 @@ while True:
alpha += step
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.)
'''
else:
output = make_inference(I0, I1, 2**args.exp-1) if args.exp else []