@@ -64,6 +64,8 @@ def is_processing_required(self, frame_num: int) -> bool:
6464
6565 True otherwise (i.e. the frame_img passed to process_frame is required
6666 to be passed to process_frame for the given frame_num).
67+
68+ :meta private:
6769 """
6870 metric_keys = self .get_metrics ()
6971 return not metric_keys or not (
@@ -132,6 +134,8 @@ class SparseSceneDetector(SceneDetector):
132134 as opposed to just a single cut.
133135
134136 An example of a SparseSceneDetector is the MotionDetector.
137+
138+ :meta private:
135139 """
136140
137141 def process_frame (
@@ -160,13 +164,22 @@ def post_process(self, frame_num: int) -> ty.List[ty.Tuple[int, int]]:
160164
161165
162166class FlashFilter :
167+ """Filters fast-cuts to enforce minimum scene length."""
168+
163169 class Mode (Enum ):
170+ """Which mode the filter should use for enforcing minimum scene length."""
171+
164172 MERGE = 0
165173 """Merge consecutive cuts shorter than filter length."""
166174 SUPPRESS = 1
167175 """Suppress consecutive cuts until the filter length has passed."""
168176
169177 def __init__ (self , mode : Mode , length : int ):
178+ """
179+ Arguments:
180+ mode: The mode to use when enforcing `length`.
181+ length: Number of frames to use when filtering cuts.
182+ """
170183 self ._mode = mode
171184 self ._filter_length = length # Number of frames to use for activating the filter.
172185 self ._last_above = None # Last frame above threshold.
@@ -176,7 +189,6 @@ def __init__(self, mode: Mode, length: int):
176189
177190 @property
178191 def max_behind (self ) -> int :
179- """Maximum number of frames a filtered cut can be behind the current frame."""
180192 return 0 if self ._mode == FlashFilter .Mode .SUPPRESS else self ._filter_length
181193
182194 def filter (self , frame_num : int , above_threshold : bool ) -> ty .List [int ]:
0 commit comments