MCPcopy Create free account
hub / github.com/CompVis/diff2flow / delta1_accuracy

Function delta1_accuracy

diff2flow/dataset/depth_utils.py:95–100  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

93
94
95def delta1_accuracy(pred, target):
96 if pred.shape[1] == 3:
97 pred = pred.mean(dim=1, keepdim=True)
98 if target.shape[1] == 3:
99 target = target.mean(dim=1, keepdim=True)
100 return torch.mean((torch.max(pred / target, target / pred) < 1.25).float())
101
102
103def percentile_per_sample(x, percentile):

Callers 1

__call__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected