panoptic_fpn.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmdet.registry import MODELS
  3. from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  4. from .panoptic_two_stage_segmentor import TwoStagePanopticSegmentor
  5. @MODELS.register_module()
  6. class PanopticFPN(TwoStagePanopticSegmentor):
  7. r"""Implementation of `Panoptic feature pyramid
  8. networks <https://arxiv.org/pdf/1901.02446>`_"""
  9. def __init__(
  10. self,
  11. backbone: ConfigType,
  12. neck: OptConfigType = None,
  13. rpn_head: OptConfigType = None,
  14. roi_head: OptConfigType = None,
  15. train_cfg: OptConfigType = None,
  16. test_cfg: OptConfigType = None,
  17. data_preprocessor: OptConfigType = None,
  18. init_cfg: OptMultiConfig = None,
  19. # for panoptic segmentation
  20. semantic_head: OptConfigType = None,
  21. panoptic_fusion_head: OptMultiConfig = None) -> None:
  22. super().__init__(
  23. backbone=backbone,
  24. neck=neck,
  25. rpn_head=rpn_head,
  26. roi_head=roi_head,
  27. train_cfg=train_cfg,
  28. test_cfg=test_cfg,
  29. data_preprocessor=data_preprocessor,
  30. init_cfg=init_cfg,
  31. semantic_head=semantic_head,
  32. panoptic_fusion_head=panoptic_fusion_head)