def _do_python_keypoint_eval(self, res_file):
    'Keypoint evaluation using COCOAPI.'
    coco_det = self.coco.loadRes(res_file)
    cuts = np.cumsum([0, self.body_num, self.foot_num, self.face_num, self.left_hand_num, self.right_hand_num])
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_body', self.sigmas[cuts[0]:cuts[1]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_foot', self.sigmas[cuts[1]:cuts[2]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_face', self.sigmas[cuts[2]:cuts[3]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_lefthand', self.sigmas[cuts[3]:cuts[4]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_righthand', self.sigmas[cuts[4]:cuts[5]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_wholebody', self.sigmas, use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    stats_names = ['AP', 'AP .5', 'AP .75', 'AP (M)', 'AP (L)', 'AR', 'AR .5', 'AR .75', 'AR (M)', 'AR (L)']
    info_str = list(zip(stats_names, coco_eval.stats))
    return info_str
Keypoint evaluation using COCOAPI.
def _do_python_keypoint_eval(self, res_file):
    
    coco_det = self.coco.loadRes(res_file)
    cuts = np.cumsum([0, self.body_num, self.foot_num, self.face_num, self.left_hand_num, self.right_hand_num])
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_body', self.sigmas[cuts[0]:cuts[1]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_foot', self.sigmas[cuts[1]:cuts[2]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_face', self.sigmas[cuts[2]:cuts[3]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_lefthand', self.sigmas[cuts[3]:cuts[4]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_righthand', self.sigmas[cuts[4]:cuts[5]], use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    coco_eval = COCOeval(self.coco, coco_det, 'keypoints_wholebody', self.sigmas, use_area=True)
    coco_eval.params.useSegm = None
    coco_eval.evaluate()
    coco_eval.accumulate()
    coco_eval.summarize()
    stats_names = ['AP', 'AP .5', 'AP .75', 'AP (M)', 'AP (L)', 'AR', 'AR .5', 'AR .75', 'AR (M)', 'AR (L)']
    info_str = list(zip(stats_names, coco_eval.stats))
    return info_str