MCPcopy Create free account
hub / github.com/DIVE128/DMVSNet / Thres_metrics

Function Thres_metrics

tools.py:190–201  ·  view source on GitHub ↗
(depth_est, depth_gt, mask, thres,return_Mean=False)

Source from the content-addressed store, hash-verified

188@torch.no_grad()
189@compute_metrics_for_each_image
190def 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
204def generate_pointcloud(rgb, depth, ply_file, intr, scale=1.0):

Callers 2

train_epochMethod · 0.85
validateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected