2021-08-17 19:52:42 +08:00
|
|
|
# Copyright (c) OpenMMLab. All rights reserved.
|
2022-05-10 17:45:10 +08:00
|
|
|
from mmcls.registry import MODELS
|
2020-05-21 21:21:43 +08:00
|
|
|
|
2021-05-14 23:36:56 +08:00
|
|
|
BACKBONES = MODELS
|
|
|
|
NECKS = MODELS
|
|
|
|
HEADS = MODELS
|
|
|
|
LOSSES = MODELS
|
|
|
|
CLASSIFIERS = MODELS
|
2020-05-21 21:21:43 +08:00
|
|
|
|
|
|
|
|
2020-06-12 14:40:27 +08:00
|
|
|
def build_backbone(cfg):
|
2021-05-14 23:36:56 +08:00
|
|
|
"""Build backbone."""
|
|
|
|
return BACKBONES.build(cfg)
|
2020-06-12 14:40:27 +08:00
|
|
|
|
|
|
|
|
2021-05-14 23:36:56 +08:00
|
|
|
def build_neck(cfg):
|
|
|
|
"""Build neck."""
|
|
|
|
return NECKS.build(cfg)
|
2020-07-07 19:32:06 +08:00
|
|
|
|
|
|
|
|
2021-05-14 23:36:56 +08:00
|
|
|
def build_head(cfg):
|
|
|
|
"""Build head."""
|
|
|
|
return HEADS.build(cfg)
|
2020-07-07 19:32:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
def build_loss(cfg):
|
2021-05-14 23:36:56 +08:00
|
|
|
"""Build loss."""
|
|
|
|
return LOSSES.build(cfg)
|
2020-07-07 19:32:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
def build_classifier(cfg):
|
2022-05-10 17:45:10 +08:00
|
|
|
"""Build classifier."""
|
2021-05-14 23:36:56 +08:00
|
|
|
return CLASSIFIERS.build(cfg)
|