MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / depth2disparity

Function depth2disparity

eval_code/recons/utils/depth.py:101–111  ·  view source on GitHub ↗
(depth, return_mask=False)

Source from the content-addressed store, hash-verified

99
100
101def depth2disparity(depth, return_mask=False):
102 if isinstance(depth, torch.Tensor):
103 disparity = torch.zeros_like(depth)
104 elif isinstance(depth, np.ndarray):
105 disparity = np.zeros_like(depth)
106 non_negtive_mask = depth > 0
107 disparity[non_negtive_mask] = 1.0 / depth[non_negtive_mask]
108 if return_mask:
109 return disparity, non_negtive_mask
110 else:
111 return disparity
112
113
114def absolute_error_loss(params, predicted_depth, ground_truth_depth):

Callers 1

depth_evaluationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected