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 - Dan64 - 16.03.2024 Now in the script is generate the string "dd_method_params=[0.6,2,0.15,0.2]", while should be generate "dd_method_params: list = [0.6, 2.0, 0.15, 0.2, False]" if "invert merger order" is unchecked and "dd_method_params: list = [0.6, 2.0, 0.15, 0.2, True]" if "invert merger order" is checked. Dan RE: Deoldify Vapoursynth filter - Selur - 16.03.2024 DOH, forgot to add a variable to the string generation. Updated the download, should be fixed now. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 16.03.2024 (16.03.2024, 11:38)Selur Wrote: DOH, forgot to add a variable to the string generation. The file in the zip is dated: 16/03/2024 09:37, so I think that is still the previous version since the behavior is still the same. Dan RE: Deoldify Vapoursynth filter - Selur - 16.03.2024 typo, should work now. RE: Deoldify Vapoursynth filter - Dan64 - 16.03.2024 Hello Selur, I'm looking to a way to stabilize the colors. This filter must be a temporal filter. The simplest way is to average the current frames with the previous frames. I found the description of misc.AverageFrames But I was unable to find it. This code is not working: clip = core.misc.AverageFrames(clip, [0.25, 0.25, 0.25]) Do you know how I can activate it ? Thanks, Dan P.S. The new version is working. RE: Deoldify Vapoursynth filter - Selur - 16.03.2024 Quote: I found the description of misc.AverageFramesMiscFilter => https://github.com/vapoursynth/vs-miscfilters-obsolete Quote:This code is not working:Did you load the filter dll? (MiscFilters) In a custom-section adding: core.std.LoadPlugin(path="%FILTERPATH%/MiscFilter/MiscFilters/MiscFilters.dll") If it's used, for a specific dd_method I can adjust Hybrid to automatically load it. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 16.03.2024 Hello Selur, good news! I found an effective way to stabilize the clip's colors by using the filter AverageFrames. Unfortunately I cannot add it in my filter because in not working if called inside a vpy filter. So this filter must be managed directly in Hybrid's GUI. This filter act as a temporal filter since the average is performed both on past and future frames. The type of average can be controlled using the weights, the max number of weights is 31, and must be used a (integer) odd number of weights because it is used a central average. It is better add this filter as a post process filter in the "Coloring" page. The options to be added are: 1) Number of frames (integer, max 31) 2) The type of average: Central Average, Left Average (only past frames), Right Average (only future frames) 3) Scene Change detection (boolean): if true in the case of change scene detection the future frames are not used Weight computation: Given N the number of frames detected [if N%2==0: N+=1, N=min(N,31)] The lateral weights can be calculated as: Wi=trunc(100/N) Then the central weight can be calculated as: Wc=100-(N-1)*Wi Supposing N=11, we have: Wi=trunc(100/11)=9 Wc=100-9*10=10. Example of "Central Average" with 11 frames clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion") Example of "Left Average" with 11 frames clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion") Example of "Right Average" with 11 frames clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion") The Average must be performed on YUV color-space, using only the plans "U","V", because we are interested in stabilize the chroma components. The attached file VideoTest_small1_DV+DD_AF31C.zip is an example of result obtained using a "Central Average" with 31 frames and scenechange =False, using the code clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion") As reference I attached also the file VideoTest_small1_DV+DD.zip that was obtained using the default settings from vsdeoldify import ddeoldify I hope that you will include this filter Hybrid. Thanks, Dan RE: Deoldify Vapoursynth filter - Selur - 16.03.2024 Quote:Unfortunately I cannot add it in my filter because in not working if called inside a vpy filter.any details on that? I think the most sensical way would be to write a Python script which stabilizes the chroma using AverageFrames. => I'll think about it a bit. Cu Selur RE: Deoldify Vapoursynth filter - Selur - 16.03.2024 Does: import math Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 16.03.2024 I rewritten the filter and now it is working, here python code def vs_clip_color_stabilizer(clip: vs.VideoNode = None, nframes: int = 5, scenechange: bool = True) -> vs.VideoNode: I will add this filter directly in ddeoldify, but the plugin "MiscFilters.dll" must be loaded by Hybrid. Thanks, Dan |