From e16f728512e9df0ed8c1f216d9a91a3aa65efc8d Mon Sep 17 00:00:00 2001 From: Alexey Borsky Date: Sun, 14 May 2023 17:25:17 +0300 Subject: [PATCH] better histogram matching. Issue #57 --- scripts/core/txt2vid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/core/txt2vid.py b/scripts/core/txt2vid.py index 0a3c3e6..eda4b71 100644 --- a/scripts/core/txt2vid.py +++ b/scripts/core/txt2vid.py @@ -154,7 +154,7 @@ def start_process(*args): processed_frames, _, _, _ = utils.img2img(args_dict) processed_frame = np.array(processed_frames[0]) - processed_frame = skimage.exposure.match_histograms(processed_frame, init_frame, channel_axis=None) + processed_frame = skimage.exposure.match_histograms(processed_frame, init_frame, channel_axis=-1) processed_frame = np.clip(processed_frame, 0, 255).astype(np.uint8) args_dict['mode'] = 0 @@ -166,7 +166,7 @@ def start_process(*args): #utils.set_CNs_input_image(args_dict, Image.fromarray(curr_frame)) processed_frames, _, _, _ = utils.img2img(args_dict) processed_frame = np.array(processed_frames[0]) - processed_frame = skimage.exposure.match_histograms(processed_frame, init_frame, channel_axis=None) + processed_frame = skimage.exposure.match_histograms(processed_frame, init_frame, channel_axis=-1) processed_frame = np.clip(processed_frame, 0, 255).astype(np.uint8) output_video.write(cv2.cvtColor(processed_frame, cv2.COLOR_RGB2BGR))