horizontal flip data: [N, F, 17, D] or [F, 17, D]. X (horizontal coordinate) is the first channel in D. Return result: same
(data)
| 52 | return result |
| 53 | |
| 54 | def flip_data(data): |
| 55 | """ |
| 56 | horizontal flip |
| 57 | data: [N, F, 17, D] or [F, 17, D]. X (horizontal coordinate) is the first channel in D. |
| 58 | Return |
| 59 | result: same |
| 60 | """ |
| 61 | left_joints = [4, 5, 6, 11, 12, 13] |
| 62 | right_joints = [1, 2, 3, 14, 15, 16] |
| 63 | flipped_data = copy.deepcopy(data) |
| 64 | flipped_data[..., 0] *= -1 # flip x of all joints |
| 65 | flipped_data[..., left_joints+right_joints, :] = flipped_data[..., right_joints+left_joints, :] |
| 66 | return flipped_data |
| 67 | |
| 68 | def resample(ori_len, target_len, replay=False, randomness=True): |
| 69 | if replay: |
no outgoing calls
no test coverage detected