__init__.py 597 B

12345678910111213141516171819
  1. from .yolof_head import YolofHead
  2. from .fcos_head import FcosHead, FcosRTHead, FcosPSSHead
  3. # build head
  4. def build_head(cfg, in_dim, out_dim):
  5. print('==============================')
  6. print('Head: {}'.format(cfg.head))
  7. if cfg.head == 'fcos_head':
  8. model = FcosHead(cfg, in_dim, out_dim)
  9. elif cfg.head == 'fcos_rt_head':
  10. model = FcosRTHead(cfg, in_dim, out_dim)
  11. elif cfg.head == 'fcos_pss_head':
  12. model = FcosPSSHead(cfg, in_dim, out_dim)
  13. elif cfg.head == 'yolof_head':
  14. model = YolofHead(cfg, in_dim, out_dim)
  15. return model