The sample selected is in a bright situation, the worst happen on dark scenes.
I updated the filter introducing a "
gradient mask" merge.
This merge is controlled by 2 parameters: dark_luma, white_luma
Merging img1 and img2 with this method: till the luma of img2 < dark_luma, will be copied the prixels from img1, for luma > white_luma will be copied the pixels from img2.
In between the pixels of img1 and img2 are weighted summed with the weight that will move from 1 (only pixels of img1) to 0 (only pixels of img2).
The ddeoldify function is
def ddeoldify(
clip: vs.VideoNode, model: int = 0, render_factor: int = 24, sat: list = [1.0,1.0], hue: list = [0.0,0.0], dd_model: int = 1, dd_render_factor: int = 24,
dd_tweak_luma_bind: list = [False, 0.4, 0.4], dd_bright: float = 0, dd_cont: float = 1, dd_gamma: float = 1, dd_method: int = 2, ddcolor_weight: float = 0.5,
dd_method_params: list = [0.6, 2.0, 0.15, 0.2, False], chroma_resize: bool = True, luma_mask: list = [0.3, 0.6, 1.0], dark_darkness: list = [False, 0.3, 0.3, 0.2, -0.05], device_index: int = 0, n_threads: int = 8, dd_num_streams: int = 1, torch_hub_dir: str = model_dir
respect to the version 2024-03-14, I applied the following changes:
1) the parameters luma_mask_limit, luma_mask_sat has been include in the list luma_mask[] with the added parameter luma_white_limit (equivalent of white_luma)
2) the list dd_method_params[] has been extended with the boolean parameter invert_clips (if true invert the clip order in the Merge methods)
3) the list dark_darkness has been extended with the parameter white_threshold
more info are in __init__.py
I attached the source code.
Dan