From 7f50665fb3835a238f6a721a8035ee26757735d8 Mon Sep 17 00:00:00 2001 From: Xuanlong Yu <43437272+xuanlongORZ@users.noreply.github.com> Date: Wed, 25 May 2022 18:00:39 +0200 Subject: [PATCH] Update uncertainty_eval.py --- SLURP_monocular_depth/pytorch/uncertainty_eval.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SLURP_monocular_depth/pytorch/uncertainty_eval.py b/SLURP_monocular_depth/pytorch/uncertainty_eval.py index a22139a..12d6888 100644 --- a/SLURP_monocular_depth/pytorch/uncertainty_eval.py +++ b/SLURP_monocular_depth/pytorch/uncertainty_eval.py @@ -26,8 +26,11 @@ def sparsification_error(unc_npy, err_npy, nb_bins = 20, return_hist=False, gt_n # Get the index of the sorted vector # From small to big argsorted_U = np.argsort(unc_npy) - argsorted_E = np.argsort(err_npy) - + if is_rmse: + argsorted_E = np.argsort(err_npy) + else: + argsorted_E = np.argsort(err_npy/gt_npy) + total_len = len(unc_npy) # Each time we calculate the remaining errors of the true error array, @@ -92,4 +95,4 @@ def AUROC(gt_npy, pred_npy, unc_npy, is_depth = True): except ValueError: print('ValueError') return 0, 0 - return roc_auc, 1 \ No newline at end of file + return roc_auc, 1