Perform data augmentation with half-body transform.
(self, results)
| 152 | return center, scale |
| 153 | |
| 154 | def __call__(self, results): |
| 155 | """Perform data augmentation with half-body transform.""" |
| 156 | joints_3d = results['joints_3d'] |
| 157 | joints_3d_visible = results['joints_3d_visible'] |
| 158 | |
| 159 | if (np.sum(joints_3d_visible[:, 0]) > self.num_joints_half_body |
| 160 | and np.random.rand() < self.prob_half_body): |
| 161 | |
| 162 | c_half_body, s_half_body = self.half_body_transform( |
| 163 | results['ann_info'], joints_3d, joints_3d_visible) |
| 164 | |
| 165 | if c_half_body is not None and s_half_body is not None: |
| 166 | results['center'] = c_half_body |
| 167 | results['scale'] = s_half_body |
| 168 | |
| 169 | return results |
| 170 | |
| 171 | class TopDownGetRandomScaleRotation: |
| 172 | """Data augmentation with random scaling & rotating. |
nothing calls this directly
no test coverage detected