26 lines
630 B
Python
Raw Normal View History

2020-02-10 07:38:56 +08:00
# encoding: utf-8
"""
@author: liaoxingyu
@contact: sherlockliao01@gmail.com
"""
from ...utils.registry import Registry
2020-02-10 22:13:04 +08:00
REID_HEADS_REGISTRY = Registry("HEADS")
2020-02-10 07:38:56 +08:00
REID_HEADS_REGISTRY.__doc__ = """
2021-01-22 21:11:19 +08:00
Registry for reid heads in a baseline model.
2020-02-10 07:38:56 +08:00
ROIHeads take feature maps and region proposals, and
perform per-region computation.
The registered object will be called with `obj(cfg, input_shape)`.
The call is expected to return an :class:`ROIHeads`.
"""
def build_heads(cfg):
2020-02-10 07:38:56 +08:00
"""
Build REIDHeads defined by `cfg.MODEL.REID_HEADS.NAME`.
"""
2020-02-10 22:13:04 +08:00
head = cfg.MODEL.HEADS.NAME
return REID_HEADS_REGISTRY.get(head)(cfg)