MCPcopy Index your code
hub / github.com/DIVE128/DMVSNet / AbsDepthError_metrics

Function AbsDepthError_metrics

tools.py:178–185  ·  view source on GitHub ↗
(depth_est, depth_gt, mask, thres=None)

Source from the content-addressed store, hash-verified

176@torch.no_grad()
177@compute_metrics_for_each_image
178def 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()

Callers 2

train_epochMethod · 0.85
validateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected