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

Function absolute_value_scaling

eval_code/recons/utils/depth.py:123–136  ·  view source on GitHub ↗
(predicted_depth, ground_truth_depth, s=1, t=0)

Source from the content-addressed store, hash-verified

121
122
123def absolute_value_scaling(predicted_depth, ground_truth_depth, s=1, t=0):
124 predicted_depth_np = predicted_depth.cpu().numpy().reshape(-1)
125 ground_truth_depth_np = ground_truth_depth.cpu().numpy().reshape(-1)
126
127 initial_params = [s, t] # s = 1, t = 0
128
129 result = minimize(
130 absolute_error_loss,
131 initial_params,
132 args=(predicted_depth_np, ground_truth_depth_np),
133 )
134
135 s, t = result.x
136 return s, t
137
138
139def absolute_value_scaling2(

Callers 1

depth_evaluationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected