Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/gradio_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .utils.video import get_fps, has_audio_stream, concat_frames, images2video, add_audio_to_video
from .utils.helper import is_square_video, mkdir, dct2device, basename
from .utils.retargeting_utils import calc_eye_close_ratio, calc_lip_close_ratio

from skimage.exposure import match_histograms

def update_args(args, user_args):
"""update the args according to user inputs
Expand Down Expand Up @@ -426,6 +426,8 @@ def execute_video_retargeting(self, input_lip_ratio: float, input_video, retarge
I_p_lst.append(I_p_i)

if flag_do_crop_input_retargeting_video:
I_p_i = match_histograms(I_p_i,img_crop_256x256_lst[i])
I_p_i = np.clip(I_p_i,0,255).astype(np.uint8)
I_p_pstbk = paste_back(I_p_i, source_M_c2o_lst[i], source_rgb_lst[i], mask_ori_lst[i])
I_p_pstbk_lst.append(I_p_pstbk)
else:
Expand All @@ -447,6 +449,8 @@ def execute_video_retargeting(self, input_lip_ratio: float, input_video, retarge
I_p_lst.append(I_p_i)

if flag_do_crop_input_retargeting_video:
I_p_i = match_histograms(I_p_i,img_crop_256x256_lst[i])
I_p_i = np.clip(I_p_i,0,255).astype(np.uint8)
I_p_pstbk = paste_back(I_p_i, source_M_c2o_lst[i], source_rgb_lst[i], mask_ori_lst[i])
I_p_pstbk_lst.append(I_p_pstbk)

Expand Down