Skip to content

[Bug] Depth output contains Inf values causing depth visualization to render white (moge-2) #6

@ascv0228

Description

@ascv0228

While using the moge-2 model for depth inference, the output depth tensor frequently contains Inf values, which leads to invalid statistics and breaks downstream visualization.

Specifically:
depth_map contains infinite.

depth_normalized = self._normalize_depth_for_visualization(depth_estimation.depth_map)

plt.imshow(depth_normalized, cmap='plasma')
plt.colorbar()

When visualizing the depth map with matplotlib, the result appears entirely white.

_save_results in depth_estimation.py

depth_fixed = depth_estimation.depth_map.copy()
depth_fixed[np.isinf(depth_fixed)] = np.nan
valid_max = np.nanmax(depth_fixed)
depth_map = np.nan_to_num(depth_fixed, nan=valid_max)

# Save depth map as image
depth_normalized = self._normalize_depth_for_visualization(depth_map)

before

Image

after
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions