(predicted_depth, ground_truth_depth, s=1, t=0)
| 121 | |
| 122 | |
| 123 | def 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 | |
| 139 | def absolute_value_scaling2( |