crowddet.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 CrowdDet(TwoStageDetector):
  7. """Implementation of `CrowdDet <https://arxiv.org/abs/2003.09163>`_
  8. Args:
  9. backbone (:obj:`ConfigDict` or dict): The backbone config.
  10. rpn_head (:obj:`ConfigDict` or dict): The rpn config.
  11. roi_head (:obj:`ConfigDict` or dict): The roi config.
  12. train_cfg (:obj:`ConfigDict` or dict, optional): The training config
  13. of FCOS. Defaults to None.
  14. test_cfg (:obj:`ConfigDict` or dict, optional): The testing config
  15. of FCOS. Defaults to None.
  16. neck (:obj:`ConfigDict` or dict): The neck config.
  17. data_preprocessor (:obj:`ConfigDict` or dict, optional): Config of
  18. :class:`DetDataPreprocessor` to process the input data.
  19. Defaults to None.
  20. init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
  21. list[dict], optional): Initialization config dict.
  22. Defaults to None.
  23. """
  24. def __init__(self,
  25. backbone: ConfigType,
  26. rpn_head: ConfigType,
  27. roi_head: ConfigType,
  28. train_cfg: ConfigType,
  29. test_cfg: ConfigType,
  30. neck: OptConfigType = None,
  31. data_preprocessor: OptConfigType = None,
  32. init_cfg: OptMultiConfig = None) -> None:
  33. super().__init__(
  34. backbone=backbone,
  35. neck=neck,
  36. rpn_head=rpn_head,
  37. roi_head=roi_head,
  38. train_cfg=train_cfg,
  39. test_cfg=test_cfg,
  40. init_cfg=init_cfg,
  41. data_preprocessor=data_preprocessor)