yolof.py 1.8 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 YOLOF(SingleStageDetector):
  7. r"""Implementation of `You Only Look One-level Feature
  8. <https://arxiv.org/abs/2103.09460>`_
  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 YOLOF. Defaults to None.
  15. test_cfg (:obj:`ConfigDict` or dict, optional): The testing config
  16. of YOLOF. Defaults to None.
  17. data_preprocessor (:obj:`ConfigDict` or dict, optional):
  18. Model preprocessing config for processing the input data.
  19. it usually includes ``to_rgb``, ``pad_size_divisor``,
  20. ``pad_value``, ``mean`` and ``std``. Defaults to None.
  21. init_cfg (:obj:`ConfigDict` or dict, optional): the config to control
  22. the initialization. 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)