From 804f82a4b0fb3ba8a9f92429ac206a4714620cdf Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 24 Dec 2019 12:26:35 -0800 Subject: [PATCH] updates --- utils/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 32484956..22d8789c 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -223,8 +223,7 @@ def compute_ap(recall, precision): mpre = np.concatenate(([0.], precision, [0.])) # Compute the precision envelope - for i in range(mpre.size - 1, 0, -1): - mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i]) + mpre = np.flip(np.maximum.accumulate(np.flip(mpre))) # Integrate area under curve method = 'interp' # methods: 'continuous', 'interp'