yolo.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. # Copyright (c) 2019 Western Digital Corporation or its affiliates.
  3. from mmdet.registry import MODELS
  4. from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  5. from .single_stage import SingleStageDetector
  6. @MODELS.register_module()
  7. class YOLOV3(SingleStageDetector):
  8. r"""Implementation of `Yolov3: An incremental improvement
  9. <https://arxiv.org/abs/1804.02767>`_
  10. Args:
  11. backbone (:obj:`ConfigDict` or dict): The backbone module.
  12. neck (:obj:`ConfigDict` or dict): The neck module.
  13. bbox_head (:obj:`ConfigDict` or dict): The bbox head module.
  14. train_cfg (:obj:`ConfigDict` or dict, optional): The training config
  15. of YOLOX. Default: None.
  16. test_cfg (:obj:`ConfigDict` or dict, optional): The testing config
  17. of YOLOX. Default: None.
  18. data_preprocessor (:obj:`ConfigDict` or dict, optional):
  19. Model preprocessing config for processing the input data.
  20. it usually includes ``to_rgb``, ``pad_size_divisor``,
  21. ``pad_value``, ``mean`` and ``std``. Defaults to None.
  22. init_cfg (:obj:`ConfigDict` or dict, optional): the config to control
  23. the initialization. Defaults to None.
  24. """
  25. def __init__(self,
  26. backbone: ConfigType,
  27. neck: ConfigType,
  28. bbox_head: ConfigType,
  29. train_cfg: OptConfigType = None,
  30. test_cfg: OptConfigType = None,
  31. data_preprocessor: OptConfigType = None,
  32. init_cfg: OptMultiConfig = None) -> None:
  33. super().__init__(
  34. backbone=backbone,
  35. neck=neck,
  36. bbox_head=bbox_head,
  37. train_cfg=train_cfg,
  38. test_cfg=test_cfg,
  39. data_preprocessor=data_preprocessor,
  40. init_cfg=init_cfg)