(depth_est, depth_gt, mask, thres=None)
| 176 | @torch.no_grad() |
| 177 | @compute_metrics_for_each_image |
| 178 | def AbsDepthError_metrics(depth_est, depth_gt, mask, thres=None): |
| 179 | depth_est, depth_gt = depth_est[mask], depth_gt[mask] |
| 180 | error = (depth_est - depth_gt).abs() |
| 181 | if thres is not None: |
| 182 | error = error[(error >= float(thres[0])) & (error <= float(thres[1]))] |
| 183 | if error.shape[0] == 0: |
| 184 | return torch.tensor(0, device=error.device, dtype=error.dtype) |
| 185 | return torch.mean(error) |
| 186 | |
| 187 | |
| 188 | @torch.no_grad() |
no outgoing calls
no test coverage detected