mask_rcnn.py 1023 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmengine.config import ConfigDict
  3. from mmdet.registry import MODELS
  4. from mmdet.utils import OptConfigType, OptMultiConfig
  5. from .two_stage import TwoStageDetector
  6. @MODELS.register_module()
  7. class MaskRCNN(TwoStageDetector):
  8. """Implementation of `Mask R-CNN <https://arxiv.org/abs/1703.06870>`_"""
  9. def __init__(self,
  10. backbone: ConfigDict,
  11. rpn_head: ConfigDict,
  12. roi_head: ConfigDict,
  13. train_cfg: ConfigDict,
  14. test_cfg: ConfigDict,
  15. neck: OptConfigType = None,
  16. data_preprocessor: OptConfigType = None,
  17. init_cfg: OptMultiConfig = None) -> None:
  18. super().__init__(
  19. backbone=backbone,
  20. neck=neck,
  21. rpn_head=rpn_head,
  22. roi_head=roi_head,
  23. train_cfg=train_cfg,
  24. test_cfg=test_cfg,
  25. init_cfg=init_cfg,
  26. data_preprocessor=data_preprocessor)