Safemotion Lib
Loading...
Searching...
No Matches
build.py
Go to the documentation of this file.
1# encoding: utf-8
2"""
3@author: liaoxingyu
4@contact: sherlockliao01@gmail.com
5"""
6
7from ...utils.registry import Registry
8
9REID_HEADS_REGISTRY = Registry("HEADS")
10REID_HEADS_REGISTRY.__doc__ = """
11Registry for ROI heads in a generalized R-CNN model.
12ROIHeads take feature maps and region proposals, and
13perform per-region computation.
14The registered object will be called with `obj(cfg, input_shape)`.
15The call is expected to return an :class:`ROIHeads`.
16"""
17
18
19def build_heads(cfg):
20 """
21 Build REIDHeads defined by `cfg.MODEL.REID_HEADS.NAME`.
22 """
23 head = cfg.MODEL.HEADS.NAME
24 return REID_HEADS_REGISTRY.get(head)(cfg)