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

Function test_detector_metrics

tests/test_stats_manager.py:76–89  ·  view source on GitHub ↗

Test passing StatsManager to a SceneManager and using it for storing the frame metrics from a ContentDetector.

(test_video_file)

Source from the content-addressed store, hash-verified

74
75
76def test_detector_metrics(test_video_file):
77 """Test passing StatsManager to a SceneManager and using it for storing the frame metrics
78 from a ContentDetector.
79 """
80 video = VideoStreamCv2(test_video_file)
81 stats_manager = StatsManager()
82 scene_manager = SceneManager(stats_manager)
83 scene_manager.add_detector(ContentDetector())
84 video_fps = video.frame_rate
85 duration = FrameTimecode("00:00:05", video_fps)
86 scene_manager.auto_downscale = True
87 scene_manager.detect_scenes(video=video, duration=duration)
88 # Check that metrics were written to the StatsManager.
89 assert stats_manager.get_metrics(0, ContentDetector.METRIC_KEYS)
90
91
92def test_load_empty_stats(tmp_path: Path):

Callers

nothing calls this directly

Calls 8

add_detectorMethod · 0.95
detect_scenesMethod · 0.95
get_metricsMethod · 0.95
VideoStreamCv2Class · 0.90
StatsManagerClass · 0.90
SceneManagerClass · 0.90
ContentDetectorClass · 0.90
FrameTimecodeClass · 0.90

Tested by

no test coverage detected