Issue #76 fix
parent
14534d3174
commit
46ae16e4cb
|
|
@ -94,7 +94,7 @@ def start_process(*args):
|
||||||
args_dict = utils.get_mode_args('t2v', args_dict)
|
args_dict = utils.get_mode_args('t2v', args_dict)
|
||||||
|
|
||||||
clip_frames = np.roll(clip_frames, -1, axis=0)
|
clip_frames = np.roll(clip_frames, -1, axis=0)
|
||||||
clip_frames[-1] = cv2.resize(prev_frame, size)
|
clip_frames[-1] = cv2.resize(prev_frame[...,:3], size)
|
||||||
clip_frames_torch = flow_utils.frames_norm(torch.from_numpy(clip_frames).to(DEVICE, dtype=torch.float32))
|
clip_frames_torch = flow_utils.frames_norm(torch.from_numpy(clip_frames).to(DEVICE, dtype=torch.float32))
|
||||||
|
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ def start_process(*args):
|
||||||
flow_mask = np.clip(1 - np.linalg.norm(prev_flow_n, axis=-1)[...,None], 0, 1)
|
flow_mask = np.clip(1 - np.linalg.norm(prev_flow_n, axis=-1)[...,None], 0, 1)
|
||||||
|
|
||||||
# fix warped styled frame from duplicated that occures on the places where flow is zero, but only because there is no place to get the color from
|
# fix warped styled frame from duplicated that occures on the places where flow is zero, but only because there is no place to get the color from
|
||||||
warped_styled_frame = curr_frame.astype(float) * alpha_mask * flow_mask + warped_styled_frame.astype(float) * (1 - alpha_mask * flow_mask)
|
warped_styled_frame = curr_frame[...,:3].astype(float) * alpha_mask * flow_mask + warped_styled_frame[...,:3].astype(float) * (1 - alpha_mask * flow_mask)
|
||||||
|
|
||||||
# This clipping at lower side required to fix small trailing issues that for some reason left outside of the bright part of the mask,
|
# This clipping at lower side required to fix small trailing issues that for some reason left outside of the bright part of the mask,
|
||||||
# and at the higher part it making parts changed strongly to do it with less flickering.
|
# and at the higher part it making parts changed strongly to do it with less flickering.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue