From c4e48fb590a42fea434e56cfd8dabd4e82c0df6a Mon Sep 17 00:00:00 2001 From: Zen <46526140+master-of-zen@users.noreply.github.com> Date: Fri, 30 Oct 2020 23:37:40 +0200 Subject: [PATCH] Limit target vmaf pooling by minumum and standart deviation --- VMAF/vmaf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VMAF/vmaf.py b/VMAF/vmaf.py index 2227da5..1608fb9 100755 --- a/VMAF/vmaf.py +++ b/VMAF/vmaf.py @@ -32,9 +32,13 @@ def read_vmaf_json(file, percentile=0): # Using 2 standart deviations to weight for bad frames mean = np.mean(vmafs) dev = np.std(vmafs) + minimum = np.min(vmafs) + perc = mean - (2 * dev) + perc = max(perc, minimum) + else: perc = round(np.percentile(vmafs, percentile), 2)