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

Method metrics_exist

scenedetect/stats_manager.py:147–153  ·  view source on GitHub ↗

Metrics Exist: Checks if the given metrics/stats exist for the given frame. Returns: bool: True if the given metric keys exist for the frame, False otherwise.

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

Source from the content-addressed store, hash-verified

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.
149
150 Returns:
151 bool: True if the given metric keys exist for the frame, False otherwise.
152 """
153 return all([self._metric_exists(timecode, metric_key) for metric_key in metric_keys])
154
155 def is_save_required(self) -> bool:
156 """Is Save Required: Checks if the stats have been updated since loading.

Callers 4

test_metricsFunction · 0.95
test_load_hardcoded_fileFunction · 0.95
process_frameMethod · 0.80

Calls 1

_metric_existsMethod · 0.95

Tested by 3

test_metricsFunction · 0.76
test_load_hardcoded_fileFunction · 0.76