Skip to content

Commit

Permalink
blearndataset: Add warning for depth norm file not existing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcojob committed Oct 1, 2024
1 parent e84d83b commit 90e715d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ def get_depth(self, index):
depth = np.load(depth_path_alt)

elif depth_normalized_path.is_file():
logger.warning("found normalized depth")
if self.depth_range is not None and self.depth_min is not None:
depth_normalized = np.load(depth_normalized_path)
depth_valid_mask = (depth_normalized > 0.0) & (depth_normalized <= 1.0)
depth = np.zeros(depth_normalized.shape, dtype='float32')
depth[depth_valid_mask] = depth_normalized[depth_valid_mask] * self.depth_range + self.depth_min
logger.warning("unormalized image")

else:
logger.error("Only found normalized depth, but did not find depth normalization file")
Expand Down Expand Up @@ -218,6 +216,9 @@ def get_depth_range(self):
norm_range = norm_max - norm_min
logger.info(f'Found norm range {norm_range:.3f} m')

else:
logger.error(f"Could not find: {depth_norm_file}")

return norm_min, norm_max, norm_range

def get_depth_prior(self, index, img_copy, depth):
Expand Down

0 comments on commit 90e715d

Please sign in to comment.