瀏覽代碼

test: [LoudFE._keep_min] test min duration

main
Rob Hallam 2 月之前
父節點
當前提交
a6bd196e39
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      test/test_feature_extractors.py

+ 13
- 0
test/test_feature_extractors.py 查看文件

@@ -252,6 +252,19 @@ class TestLoudAudioFeatureExtractor(unittest.TestCase):
test_extractor.teardown()
self.assertEqual(len(test_extractor.features), 10)

# test with min_duration
min_duration = 100
with self.subTest("min_duration"):
test_extractor = extractors.LoudAudioFeatureExtractor(input_files=video_source,
min_duration=min_duration,
num_features=10)
test_extractor._get_loudnesses = self._mock_get_loudnessess
test_extractor.setup()
test_extractor.run()
test_extractor.teardown()
for feature in test_extractor.features:
self.assertGreaterEqual(feature.interval.duration, min_duration)

# TODO: add sample video with loud audio to test _loudnessdetect()

class TestVideoActivityFeatureExtractor(unittest.TestCase):


Loading…
取消
儲存