diff --git a/pipeline/feature_extractors.py b/pipeline/feature_extractors.py index 05c1f7d..4fff274 100644 --- a/pipeline/feature_extractors.py +++ b/pipeline/feature_extractors.py @@ -282,6 +282,11 @@ class VideoActivityFeatureExtractor(FeatureExtractor): ) return scores + def _drop_lowest(self, scores, percent=33): + """Drop the lowest n% scores from the list""" + scores = sorted(scores, key=lambda x: x[1], reverse=True) + return scores[:int(len(scores) * (percent / 100))] + def setup(self): pass