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

Method set_metrics

scenedetect/stats_manager.py:137–145  ·  view source on GitHub ↗

Set Metrics: Sets the provided statistics/metrics for a given frame. Arguments: timecode: Timecode to set metrics for. metric_kv_dict: Key value mapping of metrics to their values for `timecode`.

(self, timecode: int | FrameTimecode, metric_kv_dict: dict[str, ty.Any])

Source from the content-addressed store, hash-verified

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.
139
140 Arguments:
141 timecode: Timecode to set metrics for.
142 metric_kv_dict: Key value mapping of metrics to their values for `timecode`.
143 """
144 for metric_key in metric_kv_dict:
145 self._set_metric(timecode, metric_key, metric_kv_dict[metric_key])
146
147 def metrics_exist(self, timecode: int | FrameTimecode, metric_keys: ty.Iterable[str]) -> bool:
148 """Metrics Exist: Checks if the given metrics/stats exist for the given frame.

Callers 7

test_metricsFunction · 0.95
load_from_csvMethod · 0.95
process_frameMethod · 0.80
process_frameMethod · 0.80
process_frameMethod · 0.80
process_frameMethod · 0.80

Calls 1

_set_metricMethod · 0.95

Tested by 1

test_metricsFunction · 0.76