MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / auc

Function auc

common/eval_cal.py:26–42  ·  view source on GitHub ↗
(predicted, target)

Source from the content-addressed store, hash-verified

24
25
26def auc(predicted, target):
27 assert predicted.shape == target.shape
28 dis = torch.norm(predicted - target, dim=len(target.shape)-1)
29 outall = 0
30 threshold = 150
31
32 frame_num = predicted.shape[1]*1.0
33 joints_num = predicted.shape[-2]*1.0
34
35 for i in range(threshold):
36 t = torch.Tensor([float(i)/1000]).cuda()
37 out = (dis < t).float() * 1
38 outall+=out.sum() /joints_num / frame_num
39
40 outall = outall/threshold
41
42 return outall
43
44
45def test_calculation(predicted, target, action, error_sum, data_type, subject):

Callers 1

mpjpe_by_action_aucFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected