Deoldify Vapoursynth filter - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: Small Talk (https://forum.selur.net/forum-7.html) +--- Thread: Deoldify Vapoursynth filter (/thread-3595.html) |
RE: Deoldify Vapoursynth filter - Selur - 29.03.2024 Quote:1) the lists for filters "Chroma smoothing/stabilizer" start with a boolean flag to enable them.Hybrid does not really validate those arrays/lists, it just checks that the (trimmed) string: 1. start with a '[' 2. ends with a ']' 3. that when split the element at index 0 container 'True' => In theory I could parse the content and change and validate it, but I would have to adjust it each time you change the parameters, so I think for the moment I will keep it the way it is. Quote:2) Can you dedicate to the parameter "Darkness" a dedicated GUI params like "Chroma Limiter" :param darkness: parameters for darken the clip's dark portions, which sometimes are wrongly colored by the color models => Sorry, not going to happen. (maybe once vsDeoldify is more stable) Cu Selur Ps.: Fixed a small typo, uploaded a new dev, same link. RE: Deoldify Vapoursynth filter - Dan64 - 29.03.2024 (29.03.2024, 21:06)Selur Wrote:Quote:1) the lists for filters "Chroma smoothing/stabilizer" start with a boolean flag to enable them.=> In theory I could parse the content and change and validate it, but I would have to adjust it each time you change the parameters, so I think for the moment I will keep it the way it is. Ok, but if I change the param list to something like chroma_smoothing_enabled=True, chroma_smoothing_param=[0.1,0.2,0.6,0.65] Dan (29.03.2024, 21:06)Selur Wrote: Not plaining to do so, since 'darkness' has more than one element aside from the enable/disable decision and the next thing that happens when I add elements for dark_threshold and dark_amount in the ui is that you add x additional parameters. To be to be more precise respect to the version 2.x I added the following parameters 1) "darkness: list = [False, 0.2, 0.8]" 2) " enable/disable FP16 in ddcolor inference" 3) in chroma_stabilizer the parameters: 4, 5, 6, 7 For a total of 8 additional parameters. If you prefer I can try to reduce the number parameters, in order to do not exceed the number of parameters included in ver. 2.x Dan RE: Deoldify Vapoursynth filter - Selur - 29.03.2024 Quote:Ok, but if I change the param list to something like'Yes', then I could better integrate it in the ui and wouldn't have to check for 'True'. (this should be done for all parameters) You might also want to think about shortening the parameter names. (just a suggestion, since having parameters with multiple underscores usually is bad) Maybe instead of 'chroma_smoothing_enabled' and 'chroma_smoothing_param', better something like 'chr_smooth' and 'chroma_sp'? So: clip: vs.VideoNode, color_method: int = 2, merge_weight: float = 0.4, deoldify_params: list = [0, 24, 1.0, 0.0], ddcolor_params: list = [1, 24, 1.0, 0.0], ddcolor_tweaks: list = [False, 0.4, 0.4, 0.0, 1.0, 1.0, True, 1], combine_params: list = [False, 0.6, 2.0, 0.15, 0.2, 0.3, 0.6, 1.0], darkness: list = [False, 0.2, 0.8], chroma_resize: bool = True, device_index: int = 0, np_threads: int = 8, torch_hub_dir: str = model_dir) -> vs.VideoNode: clip: vs.VideoNode, method: int = 2, mweight: float = 0.4, deoldify_p: list = [0, 24, 1.0, 0.0], ddcolor_p: list = [1, 24, 1.0, 0.0], ddcolor_tweak: bool = False, ddcolor_tweakp: list = [0.4, 0.4, 0.0, 1.0, 1.0, True, 1], combine_p: list = [0.6, 2.0, 0.15, 0.2, 0.3, 0.6, 1.0], dark: bool = True, dark_p: list = [0.2, 0.8], chr_rez: bool = True, device_idx: int = 0, np: int = 8, torch_dir: str = model_dir) -> vs.VideoNode: and ddeoldify_stabilizer(clip: vs.VideoNode, chroma_smoothing: list = [False, 0.1, 0.2, 0.5, 0.8], chroma_stabilizer: list = [True, 5, 'arithmetic', 1, 60, 0.5, 0.8, 0], chroma_limiter: list = [False, 0.02], chroma_resize: list = [True, 24]) -> vs.VideoNode: ddeoldify_stab(clip: vs.VideoNode, chr_smooth: bool = False, chr_smoothp: list = [0.1, 0.2, 0.5, 0.8], chr_stab: bool = True, chr_stabp: list = [5, 'arithmetic', 1, 60, 0.5, 0.8, 0], chr_limit: bool = False, chr_limitp: list = [0.02], chr_rez: bool = True, chr_rezp: list = [True, 24]) -> vs.VideoNode: Quote:If you prefer I can try to reduce the number parameters, in order to do not exceed the number of parameters included in ver. 2.xThe 2.x already had way to many parameters. The problem is: a. integrating (and always changing, testing, adding interactions, setting tool-tips, etc.) for tons of parameter is a pain. b. having tons of parameters makes a filter not really usable, since users will just blindly flip switches and ask for help so that others tweak their settings. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 30.03.2024 I changed the functions parameters as you suggested. def ddeoldify( I performed also the following changes: 1) removed the method: Adaptive Luma Merge 2) moved fp16 flag in ddcolor_p 3) split the parameters of the 2 combining methods: CMC, LMM 4) assigned a dedicated flag to: invert clips merge def ddeoldify_stabilizer(clip: vs.VideoNode, smooth: bool = False, smooth_p: list = [0.2, 0.7, 0.9, 0.1], stab: bool = True, stab_p: list = [5, 'A', 1, 60, 0.5, 0.8], chrez: bool = True, chrez_p: int = 24) -> vs.VideoNode: I performed also the following changes: 1) removed the filter chroma limiter All the parameters have the suffix "_p", when the list contains only 1 element I substitute the list with a simple python variable, but I can keep the list (let me know) I counted 36 parameters (excluding clips and enable/disable list flags), it is still an high number, but you have to consider that there are 2 coloring filters, 3 merge methods and 4 filters Let me know I have to apply additional changes. Thanks, Dan RE: Deoldify Vapoursynth filter - Selur - 30.03.2024 Is there a scenario where it makes sense to disable 'chrez', if not, it should be removed from the parameters. Another question: Does the input resolution influence the result ? I was wondering whether resizing HD to SD resolution before applying deoldify and ddcolor and later upscale and copy the chroma to the original would make sense to speed things up or whether this would only lower the accuracy / temporal consitency? otherwise: # frame size calculation for inference() if chroma_resize_enabled: additionally: chrez: bool = True, chrez_p: int = 24) if you only got one parameter it should have it's own name so chrez_p should be render_factor. CMC_p: float = 0.2, LMM_p: list = [0.3, 0.6, 1.0] also since 'CMC_p' is has only one paramater it should be 'cmc_thresh'. maybe change 'cmb_inv' to 'cmb_sw' for combine_switch switching seems more fitting than inverse. :param LMM_p: parameters for method: "Luma Masked Merge" Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 30.03.2024 (30.03.2024, 07:57)Selur Wrote: Is there a scenario where it makes sense to disable 'chrez', if not, it should be removed from the parameters. for what concern the chroma filters: "cherez" enabled will not affect the output resolution, so it makes sense to remove from the parameter list and left it always enabled (I introduced the flag mainly for testing). Unfortunately the input resolution impacts the inference and filters speeds, that's the reason why I introduced the render factor also in the stabilizer. The downsize before the inference and then the upscale is already implemented by the render_factor, no reason to implement it externally. Also the resizer used to downscale has little impact (both deoldify and ddcolor are using "bilinear") because the luma restore is able to provide back the full original resolution. I will apply the proposed changes in the next RC. Dan P.S. The explanation of "Luma Masked Merge" is provided in the "method" description of this filter RE: Deoldify Vapoursynth filter - Selur - 30.03.2024 Quote:I will apply the proposed changes in the next RC.I'll adjust Hybrid then. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 30.03.2024 Here the new RC4. I updated some description. Dan RE: Deoldify Vapoursynth filter - Selur - 30.03.2024 deoldify_p: list = [0, 24, 1.0, 0. Quote:[3] hue parameter to apply to deoldify color model (default = 0) calling: clip = ddeoldify(clip=clip, method=3, deoldify_p=[3, 24, 1, 0], ddcolor_p=[1, 24, 1, 0, True]) File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\__init__.py", line 183, in ddeoldify '_deoldify' has no match model 3,.... Cu Selur Ps.: updated the download, but couldn't test everything due to the bug. RE: Deoldify Vapoursynth filter - Dan64 - 30.03.2024 (30.03.2024, 11:28)Selur Wrote: It is correct, for deoldify valid models are: 0, 1, 2 (the valid models are described in " :param deoldify_p: ") Dan P.S. I will release a new RC with correct description for "hue" |