本文整理汇总了Python中maskrcnn_benchmark.data.datasets.COCODataset方法的典型用法代码示例。如果您正苦于以下问题:Python datasets.COCODataset方法的具体用法?Python datasets.COCODataset怎么用?Python datasets.COCODataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maskrcnn_benchmark.data.datasets
的用法示例。
在下文中一共展示了datasets.COCODataset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: evaluate
# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import COCODataset [as 别名]
def evaluate(dataset, predictions, output_folder, **kwargs):
"""evaluate dataset using different methods based on dataset type.
Args:
dataset: Dataset object
predictions(list[BoxList]): each item in the list represents the
prediction results for one image.
output_folder: output folder, to save evaluation files or results.
**kwargs: other args.
Returns:
evaluation result
"""
args = dict(
dataset=dataset, predictions=predictions, output_folder=output_folder, **kwargs
)
if isinstance(dataset, datasets.COCODataset):
return coco_evaluation(**args)
elif isinstance(dataset, datasets.PascalVOCDataset):
return voc_evaluation(**args)
else:
dataset_name = dataset.__class__.__name__
raise NotImplementedError("Unsupported dataset type {}.".format(dataset_name))
示例2: evaluate
# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import COCODataset [as 别名]
def evaluate(dataset, predictions, output_folder, **kwargs):
"""evaluate dataset using different methods based on dataset type.
Args:
dataset: Dataset object
predictions(list[BoxList]): each item in the list represents the
prediction results for one image.
output_folder: output folder, to save evaluation files or results.
**kwargs: other args.
Returns:
evaluation result
"""
args = dict(
dataset=dataset, predictions=predictions, output_folder=output_folder, **kwargs
)
if isinstance(dataset, datasets.COCODataset):
return coco_evaluation(**args)
if isinstance(dataset, datasets.ModaNetDataset):
return coco_evaluation(**args)
elif isinstance(dataset, datasets.PascalVOCDataset):
return voc_evaluation(**args)
else:
dataset_name = dataset.__class__.__name__
raise NotImplementedError("Unsupported dataset type {}.".format(dataset_name))
示例3: evaluate
# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import COCODataset [as 别名]
def evaluate(dataset, predictions, output_folder, **kwargs):
"""evaluate dataset using different methods based on dataset type.
Args:
dataset: Dataset object
predictions(list[BoxList]): each item in the list represents the
prediction results for one image.
output_folder: output folder, to save evaluation files or results.
**kwargs: other args.
Returns:
evaluation result
"""
args = dict(
dataset=dataset, predictions=predictions, output_folder=output_folder, **kwargs
)
if isinstance(dataset, datasets.COCODataset):
return coco_evaluation(**args)
elif isinstance(dataset, datasets.PascalVOCDataset):
return voc_evaluation(**args)
elif isinstance(dataset, datasets.AbstractDataset):
return abs_cityscapes_evaluation(**args)
else:
dataset_name = dataset.__class__.__name__
raise NotImplementedError("Unsupported dataset type {}.".format(dataset_name))
示例4: coco_evaluation
# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import COCODataset [as 别名]
def coco_evaluation(
dataset,
predictions,
output_folder,
box_only,
iou_types,
expected_results,
expected_results_sigma_tol,
):
if isinstance(dataset, COCODataset):
return do_orig_coco_evaluation(
dataset=dataset,
predictions=predictions,
box_only=box_only,
output_folder=output_folder,
iou_types=iou_types,
expected_results=expected_results,
expected_results_sigma_tol=expected_results_sigma_tol,
)
elif isinstance(dataset, AbstractDataset):
return do_wrapped_coco_evaluation(
dataset=dataset,
predictions=predictions,
box_only=box_only,
output_folder=output_folder,
iou_types=iou_types,
expected_results=expected_results,
expected_results_sigma_tol=expected_results_sigma_tol,
)
else:
raise NotImplementedError(
(
"Ground truth dataset is not a COCODataset, "
"nor it is derived from AbstractDataset: type(dataset)="
"%s" % type(dataset)
)
)
示例5: evaluate
# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import COCODataset [as 别名]
def evaluate(dataset, predictions, output_folder, evaluate_method='', # add by hui evaluate_method
**kwargs):
"""evaluate dataset using different methods based on dataset type.
Args:
dataset: Dataset object
predictions(list[BoxList]): each item in the list represents the
prediction results for one image.
output_folder: output folder, to save evaluation files or results.
**kwargs: other args.
evaluate_method: 'coco' or 'voc' or ''(determine by dataset type)
Returns:
evaluation result
"""
args = dict(
dataset=dataset, predictions=predictions, output_folder=output_folder, **kwargs
)
# changed by hui ####################################################
if len(evaluate_method) == 0:
if isinstance(dataset, datasets.COCODataset):
args.pop('voc_iou_ths')
return coco_evaluation(**args)
elif isinstance(dataset, datasets.PascalVOCDataset):
return voc_evaluation(**args)
else:
dataset_name = dataset.__class__.__name__
raise NotImplementedError("Unsupported dataset type {}.".format(dataset_name))
else:
evaluate_method = evaluate_method.lower()
if evaluate_method == 'voc':
return voc_evaluation(**args)
elif evaluate_method == 'coco':
return coco_evaluation(**args)
else:
raise NotImplementedError("Unsupported evaluate method {}.".format(evaluate_method))
########################################################################################################