|
@@ -50,12 +50,7 @@ class FeatureExtractor(ABC): |
|
|
if current_feature.interval.duration < self._min_duration: |
|
|
if current_feature.interval.duration < self._min_duration: |
|
|
current_feature.interval.update_duration(self._min_duration) |
|
|
current_feature.interval.update_duration(self._min_duration) |
|
|
keep_features.append(current_feature) |
|
|
keep_features.append(current_feature) |
|
|
# drop any features that are now in that feature's range (plus margin) |
|
|
|
|
|
# features = [f for f in features if |
|
|
|
|
|
# (f.interval.start < current_feature.interval.start-margin and |
|
|
|
|
|
# f.interval.end > current_feature.interval.start-margin) or |
|
|
|
|
|
# (f.interval.end > current_feature.interval.end+margin and |
|
|
|
|
|
# f.interval.start < current_feature.interval.end+margin)] |
|
|
|
|
|
|
|
|
# drop any features that overlap |
|
|
if trim_overlap: |
|
|
if trim_overlap: |
|
|
features = [f for f in features if not f.interval.overlaps(current_feature.interval)] |
|
|
features = [f for f in features if not f.interval.overlaps(current_feature.interval)] |
|
|
|
|
|
|
|
@@ -143,7 +138,7 @@ class LaughterFeatureExtractor(FeatureExtractor): |
|
|
|
|
|
|
|
|
jrgillick's laughter-detection library can work with AV files directly! |
|
|
jrgillick's laughter-detection library can work with AV files directly! |
|
|
""" |
|
|
""" |
|
|
if not self.input_files or len(self.input_files) == 0: |
|
|
|
|
|
|
|
|
if not self.input_files: |
|
|
raise ValueError("No input files provided!") |
|
|
raise ValueError("No input files provided!") |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -410,7 +405,7 @@ class VideoActivityFeatureExtractor(FeatureExtractor): |
|
|
score=score)) |
|
|
score=score)) |
|
|
|
|
|
|
|
|
# prune features list to keep self.num_features |
|
|
# prune features list to keep self.num_features |
|
|
if len(self.features) > self._num_features: |
|
|
|
|
|
|
|
|
if len(features) > self._num_features: |
|
|
self.features = self._keep_num(features, self._num_features) |
|
|
self.features = self._keep_num(features, self._num_features) |
|
|
else: |
|
|
else: |
|
|
self.features = features |
|
|
self.features = features |
|
|