Zhen Ye commited on
Commit
9d9cecc
·
1 Parent(s): 391cb94

Fix IndentationError and undefined depth_raw variable in inference.py

Browse files
Files changed (1) hide show
  1. inference.py +3 -2
inference.py CHANGED
@@ -240,6 +240,7 @@ def _attach_depth_metrics(
240
  if finite.size == 0:
241
  continue
242
 
 
243
  if depth_raw <= 1e-6:
244
  det["depth_est_m"] = None
245
  det["depth_valid"] = False
@@ -808,8 +809,8 @@ def process_frames_depth(
808
 
809
  if not np.isfinite(global_min) or not np.isfinite(global_max):
810
  logging.warning("Depth percentiles are non-finite - using min/max fallback")
811
- global_min = float(valid_depths.min())
812
- global_max = float(valid_depths.max())
813
 
814
  # Handle edge case where min == max
815
  if abs(global_max - global_min) < 1e-6:
 
240
  if finite.size == 0:
241
  continue
242
 
243
+ depth_raw = float(np.median(finite))
244
  if depth_raw <= 1e-6:
245
  det["depth_est_m"] = None
246
  det["depth_valid"] = False
 
809
 
810
  if not np.isfinite(global_min) or not np.isfinite(global_max):
811
  logging.warning("Depth percentiles are non-finite - using min/max fallback")
812
+ global_min = float(valid_depths.min())
813
+ global_max = float(valid_depths.max())
814
 
815
  # Handle edge case where min == max
816
  if abs(global_max - global_min) < 1e-6: