Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

feature_extractors.py 928 B

123456789101112131415161718192021222324252627282930
  1. from abc import ABC
  2. import logging
  3. logger = logging.getLogger(__name__)
  4. class FeatureExtractor(ABC):
  5. """Feature extractor interface."""
  6. # TODO: #API -- decide if .features will be a member variable
  7. def setup(self):
  8. pass
  9. def run(self):
  10. pass
  11. def teardown(self):
  12. pass
  13. class LaughterFeatureExtractor(FeatureExtractor):
  14. """Feature extractor for laughter detection.
  15. This class is responsible for extracting features corresponding to laughter in media files.
  16. Here:
  17. setup() is used to validate input files & config, which may involve processing video files to extract audio
  18. run() is used to extract features from the audio using jrgillick's laughter-detection
  19. teardown() is used to clean up any temporary files created during setup according to the config
  20. See: https://github.com/jrgillick/laughter-detection for the laughter-detection library
  21. """