| 23 | return args |
| 24 | |
| 25 | def json2pose(json_dict): |
| 26 | pose_h36m = np.zeros([17,3]) |
| 27 | idx2key = ['Hip', |
| 28 | 'R Hip', |
| 29 | 'R Knee', |
| 30 | 'R Ankle', |
| 31 | 'L Hip', |
| 32 | 'L Knee', |
| 33 | 'L Ankle', |
| 34 | 'Belly', |
| 35 | 'Neck', |
| 36 | 'Nose', |
| 37 | 'Head', |
| 38 | 'L Shoulder', |
| 39 | 'L Elbow', |
| 40 | 'L Wrist', |
| 41 | 'R Shoulder', |
| 42 | 'R Elbow', |
| 43 | 'R Wrist', |
| 44 | ] |
| 45 | for i in range(17): |
| 46 | if idx2key[i]=='Belly' or idx2key[i]=='Head': |
| 47 | pose_h36m[i] = 0, 0, 0 |
| 48 | else: |
| 49 | item = json_dict[idx2key[i]] |
| 50 | pose_h36m[i] = item['x'], item['y'], item['logits'] |
| 51 | return pose_h36m |
| 52 | |
| 53 | def load_motion(json_path): |
| 54 | json_dict = json.load(open(json_path, 'r')) |