|
|
@@ -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 |
|
|
|