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

Function pck

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

Source from the content-addressed store, hash-verified

8
9
10def pck(predicted, target):
11 assert predicted.shape == target.shape
12 threshold = 150.0 / 1000
13
14 frame_num = predicted.shape[1]*1.0
15 joints_num = predicted.shape[-2]*1.0
16
17 dis = torch.norm(predicted - target, dim=len(target.shape)-1)
18
19 t = torch.Tensor([threshold]).cuda()
20 out = (dis < t).float() * 1
21 pck = out.sum() / joints_num / frame_num
22
23 return pck
24
25
26def auc(predicted, target):

Callers 1

mpjpe_by_action_pckFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected