yolox.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 YOLOX(SingleStageDetector):
  7. r"""Implementation of `YOLOX: Exceeding YOLO Series in 2021
  8. <https://arxiv.org/abs/2107.08430>`_
  9. Args:
  10. backbone (:obj:`ConfigDict` or dict): The backbone config.
  11. neck (:obj:`ConfigDict` or dict): The neck config.
  12. bbox_head (:obj:`ConfigDict` or dict): The bbox head config.
  13. train_cfg (:obj:`ConfigDict` or dict, optional): The training config
  14. of YOLOX. Defaults to None.
  15. test_cfg (:obj:`ConfigDict` or dict, optional): The testing config
  16. of YOLOX. 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 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. neck: ConfigType,
  27. bbox_head: ConfigType,
  28. train_cfg: OptConfigType = None,
  29. test_cfg: OptConfigType = None,
  30. data_preprocessor: OptConfigType = None,
  31. init_cfg: OptMultiConfig = None) -> None:
  32. super().__init__(
  33. backbone=backbone,
  34. neck=neck,
  35. bbox_head=bbox_head,
  36. train_cfg=train_cfg,
  37. test_cfg=test_cfg,
  38. data_preprocessor=data_preprocessor,
  39. init_cfg=init_cfg)