MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / __init__

Method __init__

scenedetect/stats_manager.py:99–114  ·  view source on GitHub ↗

Initialize a new StatsManager. Arguments: base_timecode: Timecode associated with this object. Must not be None (default value will be removed in a future release).

(self, base_timecode: int | FrameTimecode | None = None)

Source from the content-addressed store, hash-verified

97 """
98
99 def __init__(self, base_timecode: int | FrameTimecode | None = None):
100 """Initialize a new StatsManager.
101
102 Arguments:
103 base_timecode: Timecode associated with this object. Must not be None (default value
104 will be removed in a future release).
105 """
106 # Frame metrics keyed by either an `int` frame number or a `FrameTimecode`. Both forms
107 # hash/compare to the same dict slot (`FrameTimecode.__hash__` returns `frame_num`), so
108 # public methods accept both interchangeably for the same frame.
109 self._frame_metrics: dict[int | FrameTimecode, dict[str, float]] = dict()
110 self._metric_keys: set[str] = set()
111 self._metrics_updated: bool = False # Flag indicating if metrics require saving.
112 self._base_timecode: int | FrameTimecode | None = (
113 base_timecode # Used for timing calculations.
114 )
115
116 @property
117 def metric_keys(self) -> ty.Iterable[str]:

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected