mirror of
https://github.com/hzwer/Practical-RIFE.git
synced 2026-12-01 05:05:41 -05:00
Update inference_video.py
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user