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`.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2021-03-23 12:10:06 +08:00
|
|
|
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
|
2021-03-23 12:10:06 +08:00
|
|
|
return REID_HEADS_REGISTRY.get(head)(cfg)
|