mask2former.py 1.1 KB

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmdet.registry import MODELS
  3. from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  4. from .maskformer import MaskFormer
  5. @MODELS.register_module()
  6. class Mask2Former(MaskFormer):
  7. r"""Implementation of `Masked-attention Mask
  8. Transformer for Universal Image Segmentation
  9. <https://arxiv.org/pdf/2112.01527>`_."""
  10. def __init__(self,
  11. backbone: ConfigType,
  12. neck: OptConfigType = None,
  13. panoptic_head: OptConfigType = None,
  14. panoptic_fusion_head: OptConfigType = None,
  15. train_cfg: OptConfigType = None,
  16. test_cfg: OptConfigType = None,
  17. data_preprocessor: OptConfigType = None,
  18. init_cfg: OptMultiConfig = None):
  19. super().__init__(
  20. backbone=backbone,
  21. neck=neck,
  22. panoptic_head=panoptic_head,
  23. panoptic_fusion_head=panoptic_fusion_head,
  24. train_cfg=train_cfg,
  25. test_cfg=test_cfg,
  26. data_preprocessor=data_preprocessor,
  27. init_cfg=init_cfg)