(depth_est, depth_gt, mask, thres,return_Mean=False)
| 188 | @torch.no_grad() |
| 189 | @compute_metrics_for_each_image |
| 190 | def Thres_metrics(depth_est, depth_gt, mask, thres,return_Mean=False): |
| 191 | assert isinstance(thres, (int, float)) |
| 192 | depth_est, depth_gt = depth_est[mask], depth_gt[mask] |
| 193 | errors = torch.abs(depth_est - depth_gt) |
| 194 | err_mask = errors > thres |
| 195 | if return_Mean==True: |
| 196 | return torch.mean(err_mask.float()),errors[~err_mask].mean() |
| 197 | else: |
| 198 | if torch.isnan(torch.mean(err_mask.float())): |
| 199 | return torch.zeros_like(torch.mean(err_mask.float())) |
| 200 | else: |
| 201 | return torch.mean(err_mask.float()) |
| 202 | |
| 203 | |
| 204 | def generate_pointcloud(rgb, depth, ply_file, intr, scale=1.0): |
no outgoing calls
no test coverage detected