当前位置: 首页>>代码示例>>Python>>正文


Python datasets.COCODataset方法代码示例

本文整理汇总了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)) 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:23,代码来源:__init__.py

示例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)) 
开发者ID:simaiden,项目名称:Clothing-Detection,代码行数:25,代码来源:__init__.py

示例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)) 
开发者ID:facebookresearch,项目名称:maskrcnn-benchmark,代码行数:25,代码来源:__init__.py

示例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)
            )
        ) 
开发者ID:facebookresearch,项目名称:maskrcnn-benchmark,代码行数:39,代码来源:__init__.py

示例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))
    ######################################################################################################## 
开发者ID:ucas-vg,项目名称:TinyBenchmark,代码行数:37,代码来源:__init__.py


注:本文中的maskrcnn_benchmark.data.datasets.COCODataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。