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


Python datasets.PascalVOCDataset方法代码示例

本文整理汇总了Python中maskrcnn_benchmark.data.datasets.PascalVOCDataset方法的典型用法代码示例。如果您正苦于以下问题:Python datasets.PascalVOCDataset方法的具体用法?Python datasets.PascalVOCDataset怎么用?Python datasets.PascalVOCDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maskrcnn_benchmark.data.datasets的用法示例。


在下文中一共展示了datasets.PascalVOCDataset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: evaluate

# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import PascalVOCDataset [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 PascalVOCDataset [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 PascalVOCDataset [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: evaluate

# 需要导入模块: from maskrcnn_benchmark.data import datasets [as 别名]
# 或者: from maskrcnn_benchmark.data.datasets import PascalVOCDataset [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.PascalVOCDataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。