Daniellesry commited on
Commit
81d3127
·
1 Parent(s): 69d439b
Files changed (1) hide show
  1. tools/eval_utils.py +6 -3
tools/eval_utils.py CHANGED
@@ -101,9 +101,9 @@ def align_depth_least_square(
101
 
102
 
103
 
104
-
105
- def transfer_pred_disp2depth(all_pred_disparity, all_gt_depths, all_masks):
106
  gt_disparity,gt_non_neg_mask = depth2disparity(all_gt_depths, return_mask=True)
 
107
  pred_non_neg_mask = all_pred_disparity > 0
108
  valid_non_neg_mask = pred_non_neg_mask & gt_non_neg_mask & all_masks
109
 
@@ -117,7 +117,10 @@ def transfer_pred_disp2depth(all_pred_disparity, all_gt_depths, all_masks):
117
  align_disp_pred, a_min=1e-3, a_max=None
118
  ) # avoid 0 disparity
119
  all_pred_depths = disparity2depth(align_disp_pred)
120
- return all_pred_depths
 
 
 
121
 
122
 
123
 
 
101
 
102
 
103
 
104
+ def transfer_pred_disp2depth(all_pred_disparity, all_gt_depths, all_masks, return_scale_shift=False):
 
105
  gt_disparity,gt_non_neg_mask = depth2disparity(all_gt_depths, return_mask=True)
106
+
107
  pred_non_neg_mask = all_pred_disparity > 0
108
  valid_non_neg_mask = pred_non_neg_mask & gt_non_neg_mask & all_masks
109
 
 
117
  align_disp_pred, a_min=1e-3, a_max=None
118
  ) # avoid 0 disparity
119
  all_pred_depths = disparity2depth(align_disp_pred)
120
+ if return_scale_shift:
121
+ return all_pred_depths, scale, shift
122
+ else:
123
+ return all_pred_depths
124
 
125
 
126