示例#1
0
def _do_segmentation_eval(json_dataset, res_file, output_dir):
    coco_dt = json_dataset.COCO.loadRes(str(res_file))
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, 'segm')
    coco_eval.evaluate()
    coco_eval.accumulate()
    _log_detection_eval_metrics(json_dataset, coco_eval)
    eval_file = os.path.join(output_dir, 'segmentation_results.pkl')
    save_object(coco_eval, eval_file)
    logger.info('Wrote json eval results to: {}'.format(eval_file))
    return coco_eval
def _do_detection_eval(json_dataset, res_file, output_dir):
    coco_dt = json_dataset.COCO.loadRes(str(res_file))
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, 'bbox')
    coco_eval.evaluate()
    coco_eval.accumulate()
    _log_detection_eval_metrics(json_dataset, coco_eval)
    eval_file = os.path.join(output_dir, 'detection_results.pkl')
    save_object(coco_eval, eval_file)
    logger.info('Wrote json eval results to: {}'.format(eval_file))
    return coco_eval
示例#3
0
def _do_keypoint_eval(json_dataset, res_file, output_dir):
    ann_type = 'keypoints'
    imgIds = json_dataset.COCO.getImgIds()
    imgIds.sort()
    coco_dt = json_dataset.COCO.loadRes(res_file)
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, ann_type)
    coco_eval.params.imgIds = imgIds
    coco_eval.evaluate()
    coco_eval.accumulate()
    eval_file = os.path.join(output_dir, 'keypoint_results.pkl')
    save_object(coco_eval, eval_file)
    logger.info('Wrote json eval results to: {}'.format(eval_file))
    coco_eval.summarize()
    return coco_eval
def _do_keypoint_eval(json_dataset, res_file, output_dir):
    ann_type = 'keypoints'
    imgIds = json_dataset.COCO.getImgIds()
    imgIds.sort()
    coco_dt = json_dataset.COCO.loadRes(res_file)
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, ann_type)
    coco_eval.params.imgIds = imgIds
    coco_eval.evaluate()
    coco_eval.accumulate()
    eval_file = os.path.join(output_dir, 'keypoint_results.pkl')
    save_object(coco_eval, eval_file)
    logger.info('Wrote json eval results to: {}'.format(eval_file))
    coco_eval.summarize()
    return coco_eval
def _do_body_uv_eval(json_dataset, res_file, output_dir):
    ann_type = 'uv'
    imgIds = json_dataset.COCO.getImgIds()
    imgIds.sort()
    with open(res_file, 'rb') as f:
        res=pickle.load(f)
    coco_dt = json_dataset.COCO.loadRes(res)
    # Non-standard params used by the modified COCO API version
    # from the DensePose fork
    test_sigma = 0.255
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, ann_type, test_sigma)
    coco_eval.params.imgIds = imgIds
    coco_eval.evaluate()
    coco_eval.accumulate()
    #eval_file = os.path.join(output_dir, 'body_uv_results.pkl')
    #save_object(coco_eval, eval_file)
    #logger.info('Wrote json eval results to: {}'.format(eval_file))
    coco_eval.summarize()
    return coco_eval
def _do_body_uv_eval(json_dataset, res_file, output_dir):
    ann_type = 'uv'
    imgIds = json_dataset.COCO.getImgIds()
    imgIds.sort()
    with open(res_file, 'rb') as f:
        res=pickle.load(f)
    coco_dt = json_dataset.COCO.loadRes(res)
    # Non-standard params used by the modified COCO API version
    # from the DensePose fork
    test_sigma = 0.255
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, ann_type, test_sigma)
    coco_eval.params.imgIds = imgIds
    coco_eval.evaluate()
    coco_eval.accumulate()
    #eval_file = os.path.join(output_dir, 'body_uv_results.pkl')
    #save_object(coco_eval, eval_file)
    #logger.info('Wrote json eval results to: {}'.format(eval_file))
    coco_eval.summarize()
    return coco_eval
示例#7
0
def _do_body_uv_eval(json_dataset, res_file, output_dir):
    ann_type = 'uv'
    imgIds = json_dataset.COCO.getImgIds()
    imgIds.sort()
    res = load_object(res_file)
    coco_dt = json_dataset.COCO.loadRes(res)
    # Non-standard params used by the modified COCO API version
    # from the DensePose fork
    # global normalization factor used in per-instance evaluation
    test_sigma = 0.255
    coco_eval = denseposeCOCOeval(json_dataset.COCO, coco_dt, ann_type,
                                  test_sigma)
    coco_eval.params.imgIds = imgIds
    coco_eval.evaluate()
    coco_eval.accumulate()
    eval_file = os.path.join(output_dir, 'body_uv_results.pkl')
    save_object(coco_eval, eval_file)
    logger.info('Wrote pickle eval results to: {}'.format(eval_file))
    coco_eval.summarize()
    return coco_eval