def _coco_keypoint_results_one_category_kernel(self, data_pack):
    'Get coco keypoint results.'
    cat_id = data_pack['cat_id']
    keypoints = data_pack['keypoints']
    cat_results = []
    for img_kpts in keypoints:
        if (len(img_kpts) == 0):
            continue
        _key_points = np.array([img_kpt['keypoints'] for img_kpt in img_kpts])
        key_points = _key_points.reshape((- 1), (self.ann_info['num_joints'] * 3))
        cuts = (np.cumsum([0, self.body_num, self.foot_num, self.face_num, self.left_hand_num, self.right_hand_num]) * 3)
        result = [{'image_id': img_kpt['image_id'], 'category_id': cat_id, 'keypoints': key_point[cuts[0]:cuts[1]].tolist(), 'foot_kpts': key_point[cuts[1]:cuts[2]].tolist(), 'face_kpts': key_point[cuts[2]:cuts[3]].tolist(), 'lefthand_kpts': key_point[cuts[3]:cuts[4]].tolist(), 'righthand_kpts': key_point[cuts[4]:cuts[5]].tolist(), 'score': float(img_kpt['score']), 'center': img_kpt['center'].tolist(), 'scale': img_kpt['scale'].tolist()} for (img_kpt, key_point) in zip(img_kpts, key_points)]
        cat_results.extend(result)
    return cat_results
Get coco keypoint results.
def _coco_keypoint_results_one_category_kernel(self, data_pack):
    
    cat_id = data_pack['cat_id']
    keypoints = data_pack['keypoints']
    cat_results = []
    for img_kpts in keypoints:
        if (len(img_kpts) == 0):
            continue
        _key_points = np.array([img_kpt['keypoints'] for img_kpt in img_kpts])
        key_points = _key_points.reshape((- 1), (self.ann_info['num_joints'] * 3))
        cuts = (np.cumsum([0, self.body_num, self.foot_num, self.face_num, self.left_hand_num, self.right_hand_num]) * 3)
        result = [{'image_id': img_kpt['image_id'], 'category_id': cat_id, 'keypoints': key_point[cuts[0]:cuts[1]].tolist(), 'foot_kpts': key_point[cuts[1]:cuts[2]].tolist(), 'face_kpts': key_point[cuts[2]:cuts[3]].tolist(), 'lefthand_kpts': key_point[cuts[3]:cuts[4]].tolist(), 'righthand_kpts': key_point[cuts[4]:cuts[5]].tolist(), 'score': float(img_kpt['score']), 'center': img_kpt['center'].tolist(), 'scale': img_kpt['scale'].tolist()} for (img_kpt, key_point) in zip(img_kpts, key_points)]
        cat_results.extend(result)
    return cat_results