fcos.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmdet.registry import MODELS
  3. from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  4. from .single_stage import SingleStageDetector
  5. @MODELS.register_module()
  6. class FCOS(SingleStageDetector):
  7. """Implementation of `FCOS <https://arxiv.org/abs/1904.01355>`_
  8. Args:
  9. backbone (:obj:`ConfigDict` or dict): The backbone config.
  10. neck (:obj:`ConfigDict` or dict): The neck config.
  11. bbox_head (:obj:`ConfigDict` or dict): The bbox head 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. data_preprocessor (:obj:`ConfigDict` or dict, optional): Config of
  17. :class:`DetDataPreprocessor` to process the input data.
  18. Defaults to None.
  19. init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
  20. list[dict], optional): Initialization config dict.
  21. Defaults to None.
  22. """
  23. def __init__(self,
  24. backbone: ConfigType,
  25. neck: ConfigType,
  26. bbox_head: ConfigType,
  27. train_cfg: OptConfigType = None,
  28. test_cfg: OptConfigType = None,
  29. data_preprocessor: OptConfigType = None,
  30. init_cfg: OptMultiConfig = None) -> None:
  31. super().__init__(
  32. backbone=backbone,
  33. neck=neck,
  34. bbox_head=bbox_head,
  35. train_cfg=train_cfg,
  36. test_cfg=test_cfg,
  37. data_preprocessor=data_preprocessor,
  38. init_cfg=init_cfg)