From 8df1be5d6ef4dd1dc667490cc57dde171edcf326 Mon Sep 17 00:00:00 2001 From: srappan <26847675+srappan@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:30:59 +0000 Subject: [PATCH 1/3] Added docstrings to frequency_merge function. --- vsdenoise/freqs.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/vsdenoise/freqs.py b/vsdenoise/freqs.py index e64f92c..3354ec8 100644 --- a/vsdenoise/freqs.py +++ b/vsdenoise/freqs.py @@ -22,6 +22,31 @@ def frequency_merge( mean_diff: bool = False, planes: PlanesT = None, mv_args: KwargsT | None = None, **kwargs: Any ) -> vs.VideoNode: + """ + Merges the frequency components of the input clips. + + :param _clips: The clips to merge. + :param tr: The temporal radius to use for motion compensation. + :param mode_high: The mode to use for the high frequency components. Or specifying the clip with the high frequency components. + :param mode_low: The mode to use for the low frequency components. Or specifying the clip with the low frequency components. + :param mode_tr: The mode to use for motion compensation. If None, it defaults to the value of mode_high. + :param lowpass: The lowpass filter to used to extract low frequency components. Example: + lowpass=[ + None, + lambda i: core.fmtc.resample( + i, + h=1080, + w=1920, + kernel="lanczos", + taps=[4, 2], + fv=[1 / 1.25, 1 / 1.375], + fh=[1 / 1.25, 1 / 1.375], + ) + :param mean_diff: Whether to use the mean of the lowpass filter and the original clip to extract the low frequency components. Default is False. + :param planes: The planes to process. If None, all planes will be processed. + :param mv_args: The arguments to pass to the MVTools class. + + """ clips = flatten_vnodes(_clips) n_clips = len(clips) From e8d5b0430237547f47616fd0c5e35bec300602d5 Mon Sep 17 00:00:00 2001 From: Setsugennoao Date: Wed, 10 Apr 2024 15:50:21 +0200 Subject: [PATCH 2/3] Format --- vsdenoise/freqs.py | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/vsdenoise/freqs.py b/vsdenoise/freqs.py index 3354ec8..b9a3a4a 100644 --- a/vsdenoise/freqs.py +++ b/vsdenoise/freqs.py @@ -25,28 +25,31 @@ def frequency_merge( """ Merges the frequency components of the input clips. - :param _clips: The clips to merge. - :param tr: The temporal radius to use for motion compensation. - :param mode_high: The mode to use for the high frequency components. Or specifying the clip with the high frequency components. - :param mode_low: The mode to use for the low frequency components. Or specifying the clip with the low frequency components. - :param mode_tr: The mode to use for motion compensation. If None, it defaults to the value of mode_high. - :param lowpass: The lowpass filter to used to extract low frequency components. Example: - lowpass=[ - None, - lambda i: core.fmtc.resample( - i, - h=1080, - w=1920, - kernel="lanczos", - taps=[4, 2], - fv=[1 / 1.25, 1 / 1.375], - fh=[1 / 1.25, 1 / 1.375], - ) - :param mean_diff: Whether to use the mean of the lowpass filter and the original clip to extract the low frequency components. Default is False. - :param planes: The planes to process. If None, all planes will be processed. - :param mv_args: The arguments to pass to the MVTools class. - + :param _clips: The clips to merge. + :param tr: The temporal radius to use for motion compensation. + :param mode_high: The mode to use for the high frequency components. Or specifying the clip with the high frequency components. + :param mode_low: The mode to use for the low frequency components. Or specifying the clip with the low frequency components. + :param mode_tr: The mode to use for motion compensation. If None, it defaults to the value of mode_high. + :param lowpass: The lowpass filter to used to extract low frequency components. + Example: + ``` + lowpass=[ + None, + lambda i: core.fmtc.resample( + i, + h=1080, + w=1920, + kernel="lanczos", + taps=[4, 2], + fv=[1 / 1.25, 1 / 1.375], + fh=[1 / 1.25, 1 / 1.375], + ) + ``` + :param mean_diff: Whether to use the mean of the lowpass filter and the original clip to extract the low frequency components. Default is False. + :param planes: The planes to process. If None, all planes will be processed. + :param mv_args: The arguments to pass to the MVTools class. """ + clips = flatten_vnodes(_clips) n_clips = len(clips) From d90064273a6283271363ca4e2a405379c97ca6c5 Mon Sep 17 00:00:00 2001 From: Setsugennoao Date: Wed, 10 Apr 2024 15:52:14 +0200 Subject: [PATCH 3/3] Update freqs.py --- vsdenoise/freqs.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vsdenoise/freqs.py b/vsdenoise/freqs.py index b9a3a4a..037b7b9 100644 --- a/vsdenoise/freqs.py +++ b/vsdenoise/freqs.py @@ -27,9 +27,12 @@ def frequency_merge( :param _clips: The clips to merge. :param tr: The temporal radius to use for motion compensation. - :param mode_high: The mode to use for the high frequency components. Or specifying the clip with the high frequency components. - :param mode_low: The mode to use for the low frequency components. Or specifying the clip with the low frequency components. - :param mode_tr: The mode to use for motion compensation. If None, it defaults to the value of mode_high. + :param mode_high: The mode to use for the high frequency components or + specifying the clip with the high frequency components. + :param mode_low: The mode to use for the low frequency components or + specifying the clip with the low frequency components. + :param mode_tr: The mode to use for motion compensation. + If None, it defaults to the value of mode_high. :param lowpass: The lowpass filter to used to extract low frequency components. Example: ``` @@ -45,7 +48,8 @@ def frequency_merge( fh=[1 / 1.25, 1 / 1.375], ) ``` - :param mean_diff: Whether to use the mean of the lowpass filter and the original clip to extract the low frequency components. Default is False. + :param mean_diff: Whether to use the mean of the lowpass filter and the original clip to + extract the low frequency components. Default is False. :param planes: The planes to process. If None, all planes will be processed. :param mv_args: The arguments to pass to the MVTools class. """