faster_rcnn.py 999 B

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