# -*- coding: utf-8 -*- import os from core.utils.imports import import_dir from utils.registry import TARGET_ASSIGNERS from core.utils.common import build as _build include = ['target_assigner'] import_dir(os.path.dirname(__file__), include=include) def build(config): return _build(config, TARGET_ASSIGNERS) # only export build function to outside __all__ = ['build']
# -*- coding: utf-8 -*- from core.utils.imports import import_dir import os from core.utils.common import build as _build from utils.registry import SAMPLERS def build(config): return _build(config, SAMPLERS) # import all for register all modules into registry dict import_dir(os.path.dirname(__file__), include=['balanced_sampler']) # only export build function to outside __all__ = ['build']
# -*- coding: utf-8 -*- from core.utils.imports import import_dir import os from core.utils.common import build as _build from utils.registry import TRANSFORMS from torchvision import transforms as trans def build(config): """ building transform is different from all above, it needs combine components of transforms """ transforms = [] for trans_config in config: transforms.append(_build(trans_config, TRANSFORMS)) return trans.Compose(transforms) # import all for register all modules into registry dict import_dir(os.path.dirname(__file__)) # only export build function to outside __all__ = ['build']
# -*- coding: utf-8 -*- from core.utils.imports import import_dir from core.utils.common import build as _build import os from utils.registry import FEATURE_EXTRACTORS exclude = ['pvanet', 'mobilenet'] import_dir(os.path.dirname(__file__), exclude=exclude) def build(config): return _build(config, FEATURE_EXTRACTORS) # only export build function to outside __all__ = ['build']
# -*- coding: utf-8 -*- from core.utils.imports import import_dir import os from core.utils.common import build_class as _build from utils.registry import TARGET_ASSIGNERS def build(config): return _build(config, TARGET_ASSIGNERS) # import all for register all modules into registry dict import_dir(os.path.dirname(__file__), include=['coders']) # only export build function to outside __all__ = ['build']
# -*- coding: utf-8 -*- from core.utils.imports import import_dir import os from core.utils.common import build as _build from utils.registry import TARGET_ASSIGNERS def build(config): return _build(config, TARGET_ASSIGNERS) # import all for register all modules into registry dict import_dir(os.path.dirname(__file__), include=['assigners']) # only export build function to outside __all__ = ['build']