(pred, gt)
| 227 | |
| 228 | |
| 229 | def recover_metric_depth(pred, gt): |
| 230 | if type(pred).__module__ == torch.__name__: |
| 231 | pred = pred.cpu().numpy() |
| 232 | if type(gt).__module__ == torch.__name__: |
| 233 | gt = gt.cpu().numpy() |
| 234 | gt = gt.squeeze() |
| 235 | pred = pred.squeeze() |
| 236 | mask = (gt > 1e-8) & (pred > 1e-8) |
| 237 | |
| 238 | gt_mask = gt[mask] |
| 239 | pred_mask = pred[mask] |
| 240 | a, b = np.polyfit(pred_mask, gt_mask, deg=1) |
| 241 | pred_metric = a * pred + b |
| 242 | return pred_metric |
nothing calls this directly
no outgoing calls
no test coverage detected