Convert a flattened parameter vector to a dictionary of parameters
(self, code, num_dict)
| 189 | net.eval() |
| 190 | |
| 191 | def decompose_code(self, code, num_dict): |
| 192 | ''' Convert a flattened parameter vector to a dictionary of parameters |
| 193 | ''' |
| 194 | code_dict = {} |
| 195 | start = 0 |
| 196 | for key in num_dict: |
| 197 | end = start+int(num_dict[key]) |
| 198 | code_dict[key] = code[:, start:end] |
| 199 | start = end |
| 200 | return code_dict |
| 201 | |
| 202 | def part_from_body(self, image, part_key, points_dict, crop_joints=None): |
| 203 | ''' crop part(head/left_hand/right_hand) out from body data, joints also change accordingly |