Convert a flattened parameter vector to a dictionary of parameters
(self, code, num_dict)
| 143 | net.eval() |
| 144 | |
| 145 | def decompose_code(self, code, num_dict): |
| 146 | ''' Convert a flattened parameter vector to a dictionary of parameters |
| 147 | ''' |
| 148 | code_dict = {} |
| 149 | start = 0 |
| 150 | for key in num_dict: |
| 151 | end = start+int(num_dict[key]) |
| 152 | code_dict[key] = code[:, start:end] |
| 153 | start = end |
| 154 | return code_dict |
| 155 | |
| 156 | def part_from_body(self, image, part_key, points_dict, crop_joints=None): |
| 157 | ''' crop part(head/left_hand/right_hand) out from body data, joints also change accordingly |