浏览代码

Merge branch 'test-fes-functional'

main
Rob Hallam 2 个月前
父节点
当前提交
391f838149
共有 1 个文件被更改,包括 23 次插入1 次删除
  1. +23
    -1
      test/test_feature_extractors_functional.py

+ 23
- 1
test/test_feature_extractors_functional.py 查看文件

@@ -28,7 +28,7 @@ class FEFunctionalTest(unittest.TestCase):
class TestLaughterFEFunctional(FEFunctionalTest):
"""TestLaughterFEFunctional -- functional tests for laughter detection feature extractor"""

def test_laughter_detection(self):
def test_laughter_detection_positive(self):
"""Test laughter detection feature extractor

Uses:
@@ -61,6 +61,28 @@ class TestLaughterFEFunctional(FEFunctionalTest):
self.assertTrue(testfe.features[0].interval.start >= (START_TIME - testfe._PREPEND_TIME))
self.assertTrue(testfe.features[0].interval.end <= (END_TIME + testfe._APPEND_TIME))

def test_laughter_detection_negative(self):
"""Negative test for laughter detection feature extractor -- should not detect laughter in a silent video

Uses:
- sample_videos/sample-manual-audio-blank-video-colours.mp4
:: silent video (30s)
-- pass iff no laughter features
"""
SAMPLE_VIDEO = f"{self.SAMPLE_DIR}/sample-manual-audio-blank-video-colours.mp4"

# create mock source with the video
source = mocks.MockSource(path=SAMPLE_VIDEO)

# create the feature extractor
testfe = extractors.LaughterFeatureExtractor(input_files=[source])
testfe.setup()
testfe.run()
testfe.teardown()

# check if the feature was extracted:
self.assertFalse(testfe.features)


class TestVideoActivityFEFunctional(FEFunctionalTest):
"""TestVisualActivityFEFunctional -- functional tests for visual activity feature extractor


正在加载...
取消
保存