本文整理匯總了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))
########################################################################################################