(predicted, target)
| 24 | |
| 25 | |
| 26 | def 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 | |
| 45 | def test_calculation(predicted, target, action, error_sum, data_type, subject): |
no outgoing calls
no test coverage detected