當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。