Skip to content

Commit

Permalink
Update uncertainty_eval.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanlongORZ authored May 25, 2022
1 parent c07d62a commit 7f50665
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions SLURP_monocular_depth/pytorch/uncertainty_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
return roc_auc, 1

0 comments on commit 7f50665

Please sign in to comment.