Test passing StatsManager to a SceneManager and using it for storing the frame metrics from a ContentDetector.
(test_video_file)
| 74 | |
| 75 | |
| 76 | def 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 | |
| 92 | def test_load_empty_stats(tmp_path: Path): |
nothing calls this directly
no test coverage detected