Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Update test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Xt-Chen authored Jun 29, 2021
1 parent 1715310 commit d54b671
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def kitti_metrics_preprocess(pred, gt):
This function do some preprocessing before metrics calculation
- check zero value to avoid numerical problems;
-
Note that the input 'pred' and 'gt' are both 4D nparraies
Note that the input 'pred' and 'gt' are both 4D nparrays
return the corresponding image pair
'''
# squeeze the first and last idx(which is one in test processing)
Expand Down Expand Up @@ -97,7 +97,7 @@ def kitti_metrics_preprocess(pred, gt):
def kitti_compute_metrics(pred, gt):
"""
This function computes the metrics value on a pair of (pred, gt).
Note that the input 'pred' and 'gt' are both nparraies
Note that the input 'pred' and 'gt' are both nparrays
Return a list of result float-values which correspond to MAE, MSE, RMSE, and a1, a2, a3
"""
# test image pre-processing
Expand All @@ -110,7 +110,7 @@ def kitti_compute_metrics(pred, gt):
rmse_log = (np.log(gt) - np.log(pred)) ** 2
rmse_log = np.sqrt(rmse_log.mean())

# compute ap accuarcy
# compute ap accuracy
thresh = np.maximum((gt/pred), (pred/gt))
a1 = (thresh < 1.25).mean()
a2 = (thresh < 1.25 ** 2).mean()
Expand All @@ -125,7 +125,7 @@ def kitti_compute_metrics(pred, gt):
def nyu_compute_metrics(pred, gt):
"""
This function computes the metrics value on a pair of (pred, gt).
Note that the input 'pred' and 'gt' are both nparraies
Note that the input 'pred' and 'gt' are both nparrays
Return a list of result float-values which correspond to MAE, MSE, RMSE, and a1, a2, a3
"""
# test image pre-processing
Expand All @@ -143,7 +143,7 @@ def nyu_compute_metrics(pred, gt):
rmse_log = (np.log(gt) - np.log(pred)) ** 2
rmse_log = np.sqrt(rmse_log.mean())

# compute ap accuarcy
# compute ap accuracy
thresh = np.maximum((gt/pred), (pred/gt))
a1 = (thresh < 1.25).mean()
a2 = (thresh < 1.25 ** 2).mean()
Expand All @@ -162,7 +162,7 @@ def nyu_metrics_preprocess(pred, gt):
This function do some preprocessing before metrics calculation
- check zero value to avoid numerical problems;
-
Note that the input 'pred' and 'gt' are both 4D nparraies
Note that the input 'pred' and 'gt' are both 4D nparrays
return the corresponding image pair
'''
# squeeze the first and last idx(which is one in test processing)
Expand Down

0 comments on commit d54b671

Please sign in to comment.