Update inference_video.py

This commit is contained in:
hzwer
2021-11-11 16:07:57 +08:00
committed by GitHub
parent 98933b4323
commit 28eaa32041
+4
View File
@@ -212,9 +212,11 @@ while True:
I1_small = F.interpolate(I1, (32, 32), mode='bilinear', align_corners=False)
ssim = ssim_matlab(I0_small[:, :3], I1_small[:, :3])
break_flag = False
if ssim > 0.996:
frame = read_buffer.get() # read a new frame
if frame is None:
break_flag = True
frame = lastframe
else:
temp = frame
@@ -253,6 +255,8 @@ while True:
write_buffer.put(mid[:h, :w])
pbar.update(1)
lastframe = frame
if break_flag:
break
if args.montage:
write_buffer.put(np.concatenate((lastframe, lastframe), 1))