(predicted, target)
| 8 | |
| 9 | |
| 10 | def 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 | |
| 26 | def auc(predicted, target): |
no outgoing calls
no test coverage detected