當前位置: 首頁>>代碼示例>>Python>>正文


Python utils.build_from_cfg方法代碼示例

本文整理匯總了Python中mmdet.utils.build_from_cfg方法的典型用法代碼示例。如果您正苦於以下問題:Python utils.build_from_cfg方法的具體用法?Python utils.build_from_cfg怎麽用?Python utils.build_from_cfg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mmdet.utils的用法示例。


在下文中一共展示了utils.build_from_cfg方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: build

# 需要導入模塊: from mmdet import utils [as 別名]
# 或者: from mmdet.utils import build_from_cfg [as 別名]
def build(cfg, registry, default_args=None):
    if isinstance(cfg, list):
        modules = [
            build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg
        ]
        return nn.Sequential(*modules)
    else:
        return build_from_cfg(cfg, registry, default_args) 
開發者ID:ming71,項目名稱:mmdetection-annotated,代碼行數:10,代碼來源:builder.py

示例2: build_dataset

# 需要導入模塊: from mmdet import utils [as 別名]
# 或者: from mmdet.utils import build_from_cfg [as 別名]
def build_dataset(cfg):
    if cfg['type'] == 'RepeatDataset':
        dataset = RepeatDataset(build_dataset(cfg['dataset']), cfg['times'])
    elif isinstance(cfg['ann_file'], (list, tuple)):
        dataset = _concat_dataset(cfg)
    else:
        dataset = build_from_cfg(cfg, DATASETS)
        # ipdb.set_trace(context=35)

    return dataset 
開發者ID:ming71,項目名稱:mmdetection-annotated,代碼行數:12,代碼來源:builder.py

示例3: build_dataset

# 需要導入模塊: from mmdet import utils [as 別名]
# 或者: from mmdet.utils import build_from_cfg [as 別名]
def build_dataset(cfg, default_args=None):
    if isinstance(cfg, (list, tuple)):
        dataset = ConcatDataset([build_dataset(c, default_args) for c in cfg])
    elif cfg['type'] == 'RepeatDataset':
        dataset = RepeatDataset(
            build_dataset(cfg['dataset'], default_args), cfg['times'])
    elif isinstance(cfg['ann_file'], (list, tuple)):
        dataset = _concat_dataset(cfg, default_args)
    else:
        dataset = build_from_cfg(cfg, DATASETS, default_args)

    return dataset 
開發者ID:xieenze,項目名稱:PolarMask,代碼行數:14,代碼來源:builder.py

示例4: __init__

# 需要導入模塊: from mmdet import utils [as 別名]
# 或者: from mmdet.utils import build_from_cfg [as 別名]
def __init__(self, transforms):
        assert isinstance(transforms, collections.abc.Sequence)
        self.transforms = []
        for transform in transforms:
            if isinstance(transform, dict):
                transform = build_from_cfg(transform, PIPELINES)
                self.transforms.append(transform)
            elif callable(transform):
                self.transforms.append(transform)
            else:
                raise TypeError('transform must be callable or a dict') 
開發者ID:tascj,項目名稱:kaggle-kuzushiji-recognition,代碼行數:13,代碼來源:compose.py

示例5: build_dataset

# 需要導入模塊: from mmdet import utils [as 別名]
# 或者: from mmdet.utils import build_from_cfg [as 別名]
def build_dataset(cfg):
    if cfg['type'] == 'RepeatDataset':
        dataset = RepeatDataset(build_dataset(cfg['dataset']), cfg['times'])
    elif isinstance(cfg['ann_file'], (list, tuple)):
        dataset = _concat_dataset(cfg)
    else:
        dataset = build_from_cfg(cfg, DATASETS)

    return dataset 
開發者ID:lizhe960118,項目名稱:CenterNet,代碼行數:11,代碼來源:builder.py


注:本文中的mmdet.utils.build_from_cfg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。