From 46ae16e4cb849413c02381e6c0f885ed14a95f01 Mon Sep 17 00:00:00 2001 From: Alexey Borsky Date: Fri, 12 May 2023 00:02:48 +0300 Subject: [PATCH] Issue #76 fix --- scripts/core/txt2vid.py | 2 +- scripts/core/vid2vid.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/core/txt2vid.py b/scripts/core/txt2vid.py index a6dd230..cb6c925 100644 --- a/scripts/core/txt2vid.py +++ b/scripts/core/txt2vid.py @@ -94,7 +94,7 @@ def start_process(*args): args_dict = utils.get_mode_args('t2v', args_dict) 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)) with torch.no_grad(): diff --git a/scripts/core/vid2vid.py b/scripts/core/vid2vid.py index 3bea0c9..ffee1ec 100644 --- a/scripts/core/vid2vid.py +++ b/scripts/core/vid2vid.py @@ -192,7 +192,7 @@ def start_process(*args): 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 - 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, # and at the higher part it making parts changed strongly to do it with less flickering.