Просмотр исходного кода

feat: add _drop_lowest() to VAFE

Drops lowest n% (default:33%) of scdet scores, since it scores every
frame

Python being what it is, this could be a single line in another method
but pulling it out into another function:

 - makes explicit what we are doing and lets us document why
 - makes for easier testing
main
Rob Hallam 2 месяцев назад
Родитель
Сommit
5854f49908
1 измененных файлов: 5 добавлений и 0 удалений
  1. +5
    -0
      pipeline/feature_extractors.py

+ 5
- 0
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



Загрузка…
Отмена
Сохранить