diff --git a/.gitignore b/.gitignore index 40f6a7c..45e0359 100644 --- a/.gitignore +++ b/.gitignore @@ -142,3 +142,5 @@ cython_debug/ data/ *ipynb + +src/ diff --git a/README.md b/README.md index 9d91d7f..206ef55 100644 --- a/README.md +++ b/README.md @@ -424,3 +424,21 @@ We appreciate all contributions to improve mim. Please refer to [CONTRIBUTING.md ## License This project is released under the [Apache 2.0 license](LICENSE). + +## Projects in OpenMMLab + +- [MMCV](https://github.com/open-mmlab/mmcv): OpenMMLab foundational library for computer vision. +- [MIM](https://github.com/open-mmlab/mim): MIM Installs OpenMMLab Packages. +- [MMClassification](https://github.com/open-mmlab/mmclassification): OpenMMLab image classification toolbox and benchmark. +- [MMDetection](https://github.com/open-mmlab/mmdetection): OpenMMLab detection toolbox and benchmark. +- [MMDetection3D](https://github.com/open-mmlab/mmdetection3d): OpenMMLab's next-generation platform for general 3D object detection. +- [MMSegmentation](https://github.com/open-mmlab/mmsegmentation): OpenMMLab semantic segmentation toolbox and benchmark. +- [MMAction2](https://github.com/open-mmlab/mmaction2): OpenMMLab's next-generation action understanding toolbox and benchmark. +- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab video perception toolbox and benchmark. +- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab pose estimation toolbox and benchmark. +- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab image and video editing toolbox. +- [MMOCR](https://github.com/open-mmlab/mmocr): A comprehensive toolbox for text detection, recognition and understanding. +- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox. +- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark. +- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab fewshot learning toolbox and benchmark. +- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D human parametric model toolbox and benchmark. diff --git a/docs/_static/css/readthedocs.css b/docs/_static/css/readthedocs.css new file mode 100644 index 0000000..0978f7a --- /dev/null +++ b/docs/_static/css/readthedocs.css @@ -0,0 +1,6 @@ +.header-logo { + background-image: url("../image/mim-logo.png"); + background-size: 85px 40px; + height: 40px; + width: 85px; +} diff --git a/docs/_static/image/mim-logo.png b/docs/_static/image/mim-logo.png new file mode 100644 index 0000000..35019a0 Binary files /dev/null and b/docs/_static/image/mim-logo.png differ diff --git a/docs/api.rst b/docs/api.rst index ffe2c26..2e825cb 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,4 +1,4 @@ -API Documentation +API Reference ================= install diff --git a/docs/conf.py b/docs/conf.py index 3832dd0..97b77b4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,7 @@ import sys # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -import sphinx_rtd_theme +import pytorch_sphinx_theme sys.path.insert(0, os.path.abspath('..')) @@ -35,6 +35,7 @@ def get_version(): # The full version, including alpha/beta/rc tags +version = get_version() release = get_version() # -- General configuration --------------------------------------------------- @@ -44,9 +45,12 @@ release = get_version() # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinxcontrib.napoleon', + 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', -] + 'sphinx_markdown_tables', + 'myst_parser', + 'sphinx_copybutton', +] # yapf: disable # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -61,9 +65,114 @@ pygments_style = 'sphinx' # -- Options for HTML output ------------------------------------------------- -html_theme = 'sphinx_rtd_theme' -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = 'pytorch_sphinx_theme' +html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()] + +html_theme_options = { + 'menu': [ + { + 'name': 'GitHub', + 'url': 'https://github.com/open-mmlab/mmcv' + }, + { + 'name': + 'Docs', + 'children': [ + { + 'name': 'MMCV', + 'url': 'https://mmcv.readthedocs.io/en/latest/', + }, + { + 'name': 'MIM', + 'url': 'https://openmim.readthedocs.io/en/latest/' + }, + { + 'name': 'MMAction2', + 'url': 'https://mmaction2.readthedocs.io/en/latest/', + }, + { + 'name': 'MMClassification', + 'url': + 'https://mmclassification.readthedocs.io/en/latest/', + }, + { + 'name': 'MMDetection', + 'url': 'https://mmdetection.readthedocs.io/en/latest/', + }, + { + 'name': 'MMDetection3D', + 'url': 'https://mmdetection3d.readthedocs.io/en/latest/', + }, + { + 'name': 'MMEditing', + 'url': 'https://mmediting.readthedocs.io/en/latest/', + }, + { + 'name': 'MMGeneration', + 'url': 'https://mmgeneration.readthedocs.io/en/latest/', + }, + { + 'name': 'MMOCR', + 'url': 'https://mmocr.readthedocs.io/en/latest/', + }, + { + 'name': 'MMPose', + 'url': 'https://mmpose.readthedocs.io/en/latest/', + }, + { + 'name': 'MMSegmentation', + 'url': 'https://mmsegmentation.readthedocs.io/en/latest/', + }, + { + 'name': 'MMTracking', + 'url': 'https://mmtracking.readthedocs.io/en/latest/', + }, + { + 'name': 'MMFlow', + 'url': 'https://mmflow.readthedocs.io/en/latest/', + }, + { + 'name': 'MMFewShot', + 'url': 'https://mmfewshot.readthedocs.io/en/latest/', + }, + { + 'name': 'MMHuman3D', + 'url': 'https://mmhuman3d.readthedocs.io/en/latest/', + }, + ] + }, + { + 'name': + 'OpenMMLab', + 'children': [ + { + 'name': 'Homepage', + 'url': 'https://openmmlab.com/' + }, + { + 'name': 'GitHub', + 'url': 'https://github.com/open-mmlab/' + }, + { + 'name': 'Twitter', + 'url': 'https://twitter.com/OpenMMLab' + }, + { + 'name': 'Zhihu', + 'url': 'https://zhihu.com/people/openmmlab' + }, + ] + }, + ] +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +html_css_files = ['css/readthedocs.css'] + +# -- Extension configuration ------------------------------------------------- +# Ignore >>> when copying code +copybutton_prompt_text = r'>>> |\.\.\. ' +copybutton_prompt_is_regexp = True diff --git a/docs/customization.md b/docs/customization.md index 9dac7a5..f8aa8a4 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -1,8 +1,8 @@ -# Customization +## Customization You can customize MIM using the `~/.mimrc` file, which should be placed in your home directory. -## Customize Default Values of MIM commands +### Customize Default Values of MIM commands You can customize the default values of MIM commands with `~/.mimrc`: diff --git a/docs/index.rst b/docs/index.rst index 8b925a2..7688b4d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,3 @@ -.. mim documentation master file, created by - sphinx-quickstart on Mon May 17 21:16:26 2021. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - Welcome to mim's documentation! ================================= @@ -10,6 +5,9 @@ Welcome to mim's documentation! :maxdepth: 2 :caption: Contents + installation.md + customization.md + abbreviation.md api.rst Indices and tables diff --git a/requirements/docs.txt b/requirements/docs.txt index 7bf2a7a..e9b1eed 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,2 +1,6 @@ -sphinx_rtd_theme -sphinxcontrib-napoleon +docutils==0.16.0 +myst-parser +-e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme +sphinx==4.0.2 +sphinx-copybutton +sphinx_markdown_tables diff --git a/setup.cfg b/setup.cfg index 7db5ece..4ad7d33 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ line_length = 79 multi_line_output = 3 known_first_party = mim known_standard_library = pkg_resources,setuptools,logging,os,warnings,abc -known_third_party = click,modelindex,pandas,pip,pytest,requests,sphinx_rtd_theme,tabulate +known_third_party = click,modelindex,pandas,pip,pytest,pytorch_sphinx_theme,requests,tabulate no_lines_before = STDLIB,LOCALFOLDER default_section = THIRDPARTY include_trailing_comma = true