本文整理汇总了Python中datasets.json_dataset_evaluator.evaluate_masks方法的典型用法代码示例。如果您正苦于以下问题:Python json_dataset_evaluator.evaluate_masks方法的具体用法?Python json_dataset_evaluator.evaluate_masks怎么用?Python json_dataset_evaluator.evaluate_masks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datasets.json_dataset_evaluator
的用法示例。
在下文中一共展示了json_dataset_evaluator.evaluate_masks方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: evaluate_all
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_all(
dataset, all_boxes, all_segms, all_keyps, output_dir, use_matlab=False
):
"""Evaluate "all" tasks, where "all" includes box detection, instance
segmentation, and keypoint detection.
"""
all_results = evaluate_boxes(
dataset, all_boxes, output_dir, use_matlab=use_matlab
)
logger.info('Evaluating bounding boxes is done!')
if cfg.MODEL.MASK_ON:
results = evaluate_masks(dataset, all_boxes, all_segms, output_dir)
all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating segmentations is done!')
if cfg.MODEL.KEYPOINTS_ON:
results = evaluate_keypoints(dataset, all_boxes, all_keyps, output_dir)
all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating keypoints is done!')
return all_results
示例2: evaluate_all
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_all(
dataset, all_boxes, all_segms, all_keyps, output_dir, use_matlab=False
):
"""Evaluate "all" tasks, where "all" includes box detection, instance
segmentation.
"""
all_results = evaluate_boxes(
dataset, all_boxes, output_dir, use_matlab=use_matlab
)
logger.info('Evaluating bounding boxes is done!')
if cfg.MODEL.MASK_ON:
results = evaluate_masks(dataset, all_boxes, all_segms, output_dir)
all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating segmentations is done!')
return all_results
示例3: evaluate_masks
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_masks(dataset, all_boxes, all_segms, output_dir):
"""Evaluate instance segmentation."""
logger.info('Evaluating segmentations')
not_comp = not cfg.TEST.COMPETITION_MODE
if _use_json_dataset_evaluator(dataset):
coco_eval = json_dataset_evaluator.evaluate_masks(
dataset,
all_boxes,
all_segms,
output_dir,
use_salt=not_comp,
cleanup=not_comp
)
mask_results = _coco_eval_to_mask_results(coco_eval)
else:
raise NotImplementedError(
'No evaluator for dataset: {}'.format(dataset.name)
)
return OrderedDict([(dataset.name, mask_results)])
示例4: evaluate_masks
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_masks(dataset, all_boxes, all_segms, output_dir):
"""Evaluate instance segmentation."""
logger.info('Evaluating segmentations')
not_comp = not cfg.TEST.COMPETITION_MODE
if _use_json_dataset_evaluator(dataset):
coco_eval = json_dataset_evaluator.evaluate_masks(
dataset,
all_boxes,
all_segms,
output_dir,
use_salt=not_comp,
cleanup=not_comp
)
mask_results = _coco_eval_to_mask_results(coco_eval)
elif _use_cityscapes_evaluator(dataset):
cs_eval = cs_json_dataset_evaluator.evaluate_masks(
dataset,
all_boxes,
all_segms,
output_dir,
use_salt=not_comp,
cleanup=not_comp
)
mask_results = _cs_eval_to_mask_results(cs_eval)
else:
raise NotImplementedError(
'No evaluator for dataset: {}'.format(dataset.name)
)
return OrderedDict([(dataset.name, mask_results)])
示例5: evaluate_masks
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_masks(dataset, all_boxes, all_segms, output_dir):
"""Evaluate instance segmentation."""
logger.info('Evaluating segmentations')
not_comp = not cfg.TEST.COMPETITION_MODE
if _use_json_dataset_evaluator(dataset):
coco_eval = json_dataset_evaluator.evaluate_masks(
dataset,
all_boxes,
all_segms,
output_dir,
use_salt=not_comp,
cleanup=not_comp
)
mask_results = _coco_eval_to_mask_results(coco_eval)
elif _use_cityscapes_evaluator(dataset):
cs_eval = cs_json_dataset_evaluator.evaluate_masks(
dataset,
all_boxes,
all_segms,
output_dir,
use_salt=not_comp,
cleanup=not_comp
)
mask_results = _cs_eval_to_mask_results(cs_eval)
elif _use_no_evaluator(dataset):
mask_results = _empty_mask_results()
else:
raise NotImplementedError(
'No evaluator for dataset: {}'.format(dataset.name)
)
return OrderedDict([(dataset.name, mask_results)])
示例6: evaluate_all
# 需要导入模块: from datasets import json_dataset_evaluator [as 别名]
# 或者: from datasets.json_dataset_evaluator import evaluate_masks [as 别名]
def evaluate_all(
dataset, all_boxes, all_segms, all_keyps, all_hois, all_keyps_vcoco, output_dir, use_matlab=False
):
"""Evaluate "all" tasks, where "all" includes box detection, instance
segmentation, and keypoint detection.
"""
all_results = evaluate_boxes(
dataset, all_boxes, output_dir, use_matlab=use_matlab
)
logger.info('Evaluating bounding boxes is done!')
if cfg.MODEL.MASK_ON:
results = evaluate_masks(dataset, all_boxes, all_segms, output_dir)
all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating segmentations is done!')
if cfg.MODEL.KEYPOINTS_ON:
results = evaluate_keypoints(dataset, all_boxes, all_keyps, output_dir)
all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating keypoints is done!')
if cfg.MODEL.VCOCO_ON:
results = evaluate_hoi_vcoco(dataset, all_hois, output_dir)
#all_results[dataset.name].update(results[dataset.name])
# if cfg.VCOCO.KEYPOINTS_ON:
# results = evaluate_keypoints(dataset, all_boxes, all_keyps_vcoco, output_dir)
# all_results[dataset.name].update(results[dataset.name])
logger.info('Evaluating hois is done!')
return all_results