MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / get_metrics

Method get_metrics

scenedetect/stats_manager.py:126–135  ·  view source on GitHub ↗

Return the requested statistics/metrics for a given timecode. Returns: A list containing the requested frame metrics for the given frame number, ordered as they are in `metric_keys`.

(
        self, timecode: int | FrameTimecode, metric_keys: ty.Iterable[str]
    )

Source from the content-addressed store, hash-verified

124 # TODO(https://scenedetect.com/issues/507): We should support the dictionary protocol instead
125 # of using this bespoke interface. It would be useful for Pandas compatibility as well.
126 def get_metrics(
127 self, timecode: int | FrameTimecode, metric_keys: ty.Iterable[str]
128 ) -> list[ty.Any]:
129 """Return the requested statistics/metrics for a given timecode.
130
131 Returns:
132 A list containing the requested frame metrics for the given frame number, ordered as
133 they are in `metric_keys`.
134 """
135 return [self._get_metric(timecode, metric_key) for metric_key in metric_keys]
136
137 def set_metrics(self, timecode: int | FrameTimecode, metric_kv_dict: dict[str, ty.Any]) -> None:
138 """Set Metrics: Sets the provided statistics/metrics for a given frame.

Callers 5

test_metricsFunction · 0.95
test_detector_metricsFunction · 0.95
test_load_hardcoded_fileFunction · 0.95
save_to_csvMethod · 0.95

Calls 1

_get_metricMethod · 0.95

Tested by 4

test_metricsFunction · 0.76
test_detector_metricsFunction · 0.76
test_load_hardcoded_fileFunction · 0.76