Safemotion Lib
Loading...
Searching...
No Matches
smreid
fastreid
modeling
backbones
build.py
Go to the documentation of this file.
1
# encoding: utf-8
2
"""
3
@author: liaoxingyu
4
@contact: sherlockliao01@gmail.com
5
"""
6
7
from
...utils.registry
import
Registry
8
9
BACKBONE_REGISTRY =
Registry
(
"BACKBONE"
)
10
BACKBONE_REGISTRY.__doc__ =
"""
11
Registry for backbones, which extract feature maps from images
12
The registered object must be a callable that accepts two arguments:
13
1. A :class:`detectron2.config.CfgNode`
14
2. A :class:`detectron2.layers.ShapeSpec`, which contains the input shape specification.
15
It must returns an instance of :class:`Backbone`.
16
"""
17
18
19
def
build_backbone
(cfg):
20
"""
21
Build a backbone from `cfg.MODEL.BACKBONE.NAME`.
22
Returns:
23
an instance of :class:`Backbone`
24
"""
25
26
backbone_name = cfg.MODEL.BACKBONE.NAME
27
backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg)
28
return
backbone
fastreid.utils.registry.Registry
Definition
registry.py:7
fastreid.modeling.backbones.build.build_backbone
build_backbone(cfg)
Definition
build.py:19
Generated by
1.10.0