MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / build_backbone

Function build_backbone

detectron2/modeling/backbone/build.py:20–33  ·  view source on GitHub ↗

Build a backbone from `cfg.MODEL.BACKBONE.NAME`. Returns: an instance of :class:`Backbone`

(cfg, input_shape=None)

Source from the content-addressed store, hash-verified

18
19
20def build_backbone(cfg, input_shape=None):
21 """
22 Build a backbone from `cfg.MODEL.BACKBONE.NAME`.
23
24 Returns:
25 an instance of :class:`Backbone`
26 """
27 if input_shape is None:
28 input_shape = ShapeSpec(channels=len(cfg.MODEL.PIXEL_MEAN))
29
30 backbone_name = cfg.MODEL.BACKBONE.NAME
31 backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg, input_shape)
32 assert isinstance(backbone, Backbone)
33 return backbone

Callers 8

__init__Method · 0.90
test_rpnMethod · 0.90
test_rrpnMethod · 0.90
from_configMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
from_configMethod · 0.85
__init__Method · 0.85

Calls 2

ShapeSpecClass · 0.90
getMethod · 0.45

Tested by 2

test_rpnMethod · 0.72
test_rrpnMethod · 0.72