You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

conf.py 5.6 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # Configuration file for the Sphinx documentation builder.
  2. #
  3. # This file only contains a selection of the most common options. For a full
  4. # list see the documentation:
  5. # https://www.sphinx-doc.org/en/master/usage/configuration.html
  6. # -- Path setup --------------------------------------------------------------
  7. # If extensions (or modules to document with autodoc) are in another directory,
  8. # add these directories to sys.path here. If the directory is relative to the
  9. # documentation root, use os.path.abspath to make it absolute, like shown here.
  10. #
  11. import os
  12. import subprocess
  13. import sys
  14. import pytorch_sphinx_theme
  15. sys.path.insert(0, os.path.abspath('..'))
  16. # -- Project information -----------------------------------------------------
  17. project = 'MMDetection'
  18. copyright = '2018-2021, OpenMMLab'
  19. author = 'MMDetection Authors'
  20. version_file = '../mmdet/version.py'
  21. def get_version():
  22. with open(version_file, 'r') as f:
  23. exec(compile(f.read(), version_file, 'exec'))
  24. return locals()['__version__']
  25. # The full version, including alpha/beta/rc tags
  26. release = get_version()
  27. # -- General configuration ---------------------------------------------------
  28. # Add any Sphinx extension module names here, as strings. They can be
  29. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  30. # ones.
  31. extensions = [
  32. 'sphinx.ext.autodoc',
  33. 'sphinx.ext.napoleon',
  34. 'sphinx.ext.viewcode',
  35. 'recommonmark',
  36. 'sphinx_markdown_tables',
  37. 'sphinx_copybutton',
  38. ]
  39. autodoc_mock_imports = [
  40. 'matplotlib', 'pycocotools', 'terminaltables', 'mmdet.version', 'mmcv.ops'
  41. ]
  42. # Add any paths that contain templates here, relative to this directory.
  43. templates_path = ['_templates']
  44. # The suffix(es) of source filenames.
  45. # You can specify multiple suffix as a list of string:
  46. #
  47. source_suffix = {
  48. '.rst': 'restructuredtext',
  49. '.md': 'markdown',
  50. }
  51. # The master toctree document.
  52. master_doc = 'index'
  53. # List of patterns, relative to source directory, that match files and
  54. # directories to ignore when looking for source files.
  55. # This pattern also affects html_static_path and html_extra_path.
  56. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  57. # -- Options for HTML output -------------------------------------------------
  58. # The theme to use for HTML and HTML Help pages. See the documentation for
  59. # a list of builtin themes.
  60. #
  61. # html_theme = 'sphinx_rtd_theme'
  62. html_theme = 'pytorch_sphinx_theme'
  63. html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
  64. html_theme_options = {
  65. 'menu': [
  66. {
  67. 'name': 'GitHub',
  68. 'url': 'https://github.com/open-mmlab/mmdetection'
  69. },
  70. {
  71. 'name':
  72. 'Projects',
  73. 'children': [
  74. {
  75. 'name': 'MMAction2',
  76. 'url': 'https://github.com/open-mmlab/mmaction2',
  77. },
  78. {
  79. 'name': 'MMClassification',
  80. 'url': 'https://github.com/open-mmlab/mmclassification',
  81. },
  82. {
  83. 'name': 'MMDetection',
  84. 'url': 'https://github.com/open-mmlab/mmdetection',
  85. },
  86. {
  87. 'name': 'MMDetection3D',
  88. 'url': 'https://github.com/open-mmlab/mmdetection3d',
  89. },
  90. {
  91. 'name': 'MMEditing',
  92. 'url': 'https://github.com/open-mmlab/mmediting',
  93. },
  94. {
  95. 'name': 'MMGeneration',
  96. 'url': 'https://github.com/open-mmlab/mmgeneration',
  97. },
  98. {
  99. 'name': 'MMOCR',
  100. 'url': 'https://github.com/open-mmlab/mmocr',
  101. },
  102. {
  103. 'name': 'MMPose',
  104. 'url': 'https://github.com/open-mmlab/mmpose',
  105. },
  106. {
  107. 'name': 'MMSegmentation',
  108. 'url': 'https://github.com/open-mmlab/mmsegmentation',
  109. },
  110. {
  111. 'name': 'MMTracking',
  112. 'url': 'https://github.com/open-mmlab/mmtracking',
  113. },
  114. ]
  115. },
  116. {
  117. 'name':
  118. 'OpenMMLab',
  119. 'children': [
  120. {
  121. 'name': 'Homepage',
  122. 'url': 'https://openmmlab.com/'
  123. },
  124. {
  125. 'name': 'GitHub',
  126. 'url': 'https://github.com/open-mmlab/'
  127. },
  128. {
  129. 'name': 'Twitter',
  130. 'url': 'https://twitter.com/OpenMMLab'
  131. },
  132. {
  133. 'name': 'Zhihu',
  134. 'url': 'https://zhihu.com/people/openmmlab'
  135. },
  136. ]
  137. },
  138. ]
  139. }
  140. # Add any paths that contain custom static files (such as style sheets) here,
  141. # relative to this directory. They are copied after the builtin static files,
  142. # so a file named "default.css" will overwrite the builtin "default.css".
  143. html_static_path = ['_static']
  144. html_css_files = ['css/readthedocs.css']
  145. # -- Extension configuration -------------------------------------------------
  146. # Ignore >>> when copying code
  147. copybutton_prompt_text = r'>>> |\.\.\. '
  148. copybutton_prompt_is_regexp = True
  149. def builder_inited_handler(app):
  150. subprocess.run(['./stat.py'])
  151. def setup(app):
  152. app.connect('builder-inited', builder_inited_handler)

No Description

Contributors (3)