tood.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 TOOD(SingleStageDetector):
  7. r"""Implementation of `TOOD: Task-aligned One-stage Object Detection.
  8. <https://arxiv.org/abs/2108.07755>`_
  9. Args:
  10. backbone (:obj:`ConfigDict` or dict): The backbone module.
  11. neck (:obj:`ConfigDict` or dict): The neck module.
  12. bbox_head (:obj:`ConfigDict` or dict): The bbox head module.
  13. train_cfg (:obj:`ConfigDict` or dict, optional): The training config
  14. of TOOD. Defaults to None.
  15. test_cfg (:obj:`ConfigDict` or dict, optional): The testing config
  16. of TOOD. Defaults to None.
  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 dict, optional): the config to control
  21. the initialization. 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)