Fix case of 'list index out of range' for SSIMU2 scores

caused by the line removing scores that are negative
This commit is contained in:
trixoniisama
2024-12-07 10:54:56 +01:00
parent fd459548d1
commit 5d15859fb6

View File

@@ -277,7 +277,7 @@ def calculate_std_dev(score_list: list[int]):
:type score_list: list
"""
filtered_score_list = [score for score in score_list if score >= 0]
filtered_score_list = [score if score >= 0 else 0.0 for score in score_list]
sorted_score_list = sorted(filtered_score_list)
average = sum(filtered_score_list)/len(filtered_score_list)
percentile_5 = sorted_score_list[len(filtered_score_list)//20]