Skip to content

Commit 4d8229c

Browse files
authored
[Docs] Improve docs style (open-mmlab#879)
* Improve docs style * update lists * update the size of image * modify duplicate mmdet3d
1 parent cae715a commit 4d8229c

File tree

20 files changed

+255
-40
lines changed

20 files changed

+255
-40
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ All kinds of contributions are welcome, including but not limited to the followi
1212
3. commit your changes
1313
4. create a PR
1414

15-
Note
15+
:::{note}
1616

1717
- If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
1818
- If you are the author of some papers and would like to include your method to mmsegmentation,
1919
please contact Kai Chen (chenkaidev[at]gmail[dot]com). We will much appreciate your contribution.
20+
:::
2021

2122
## Code style
2223

configs/deeplabv3/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
## Results and models
1717

18-
Note: `D-8` here corresponding to the output stride 8 setting for DeepLab series.
18+
:::{note}
19+
`D-8` here corresponding to the output stride 8 setting for DeepLab series.
20+
:::
1921

2022
### Cityscapes
2123

configs/deeplabv3plus/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
## Results and models
1717

18-
Note:
18+
:::{note}
1919
`D-8`/`D-16` here corresponding to the output stride 8/16 setting for DeepLab series.
2020
`MG-124` stands for multi-grid dilation in the last stage of ResNet.
21+
:::
2122

2223
### Cityscapes
2324

docs/_static/css/readthedocs.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.header-logo {
2+
background-image: url("../images/mmsegmentation.png");
3+
background-size: 201px 40px;
4+
height: 40px;
5+
width: 201px;
6+
}
43.7 KB
Loading

docs/api.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
API Reference
2-
==============
3-
41
mmseg.apis
52
--------------
63
.. automodule:: mmseg.apis

docs/conf.py

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import subprocess
1616
import sys
1717

18+
import pytorch_sphinx_theme
19+
1820
sys.path.insert(0, os.path.abspath('..'))
1921

2022
# -- Project information -----------------------------------------------------
@@ -40,11 +42,8 @@ def get_version():
4042
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4143
# ones.
4244
extensions = [
43-
'sphinx.ext.autodoc',
44-
'sphinx.ext.napoleon',
45-
'sphinx.ext.viewcode',
46-
'recommonmark',
47-
'sphinx_markdown_tables',
45+
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
46+
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser'
4847
]
4948

5049
autodoc_mock_imports = [
@@ -75,12 +74,101 @@ def get_version():
7574
# The theme to use for HTML and HTML Help pages. See the documentation for
7675
# a list of builtin themes.
7776
#
78-
html_theme = 'sphinx_rtd_theme'
77+
# html_theme = 'sphinx_rtd_theme'
78+
html_theme = 'pytorch_sphinx_theme'
79+
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
80+
html_theme_options = {
81+
# 'logo_url': 'https://mmsegmentation.readthedocs.io/en/latest/',
82+
'menu': [
83+
{
84+
'name':
85+
'Tutorial',
86+
'url':
87+
'https://github.com/open-mmlab/mmsegmentation/blob/master/'
88+
'demo/MMSegmentation_Tutorial.ipynb'
89+
},
90+
{
91+
'name': 'GitHub',
92+
'url': 'https://github.com/open-mmlab/mmsegmentation'
93+
},
94+
{
95+
'name':
96+
'Upstream',
97+
'children': [
98+
{
99+
'name': 'MMCV',
100+
'url': 'https://github.com/open-mmlab/mmcv',
101+
'description': 'Foundational library for computer vision'
102+
},
103+
]
104+
},
105+
{
106+
'name':
107+
'Projects',
108+
'children': [
109+
{
110+
'name': 'MMAction2',
111+
'url': 'https://github.com/open-mmlab/mmaction2',
112+
},
113+
{
114+
'name': 'MMClassification',
115+
'url': 'https://github.com/open-mmlab/mmclassification',
116+
},
117+
{
118+
'name': 'MMOCR',
119+
'url': 'https://github.com/open-mmlab/mmocr',
120+
},
121+
{
122+
'name': 'MMDetection',
123+
'url': 'https://github.com/open-mmlab/mmdetection',
124+
},
125+
{
126+
'name': 'MMEditing',
127+
'url': 'https://github.com/open-mmlab/mmediting',
128+
},
129+
{
130+
'name': 'MMDetection3D',
131+
'url': 'https://github.com/open-mmlab/mmdetection3d',
132+
},
133+
{
134+
'name': 'MMPose',
135+
'url': 'https://github.com/open-mmlab/mmpose',
136+
},
137+
{
138+
'name': 'MMTracking',
139+
'url': 'https://github.com/open-mmlab/mmtracking',
140+
},
141+
{
142+
'name': 'MMGeneration',
143+
'url': 'https://github.com/open-mmlab/mmgeneration',
144+
},
145+
]
146+
},
147+
{
148+
'name':
149+
'OpenMMLab',
150+
'children': [
151+
{
152+
'name': 'Homepage',
153+
'url': 'https://openmmlab.com/'
154+
},
155+
{
156+
'name': 'GitHub',
157+
'url': 'https://github.com/open-mmlab/'
158+
},
159+
]
160+
},
161+
]
162+
}
79163

80164
# Add any paths that contain custom static files (such as style sheets) here,
81165
# relative to this directory. They are copied after the builtin static files,
82166
# so a file named "default.css" will overwrite the builtin "default.css".
83167
html_static_path = ['_static']
168+
html_css_files = ['css/readthedocs.css']
169+
170+
# Enable ::: for my_st
171+
myst_enable_extensions = ['colon_fence']
84172

85173
language = 'en'
86174

docs/get_started.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ The compatible MMSegmentation and MMCV versions are as below. Please install the
2626
| 0.7.0 | mmcv-full>=1.1.2, <1.2.0 |
2727
| 0.6.0 | mmcv-full>=1.1.2, <1.2.0 |
2828

29-
Note: You need to run `pip uninstall mmcv` first if you have mmcv installed.
29+
:::{note}
30+
You need to run `pip uninstall mmcv` first if you have mmcv installed.
3031
If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.
32+
:::
3133

3234
## Installation
3335

@@ -105,7 +107,7 @@ cd mmsegmentation
105107
pip install -e . # or "python setup.py develop"
106108
```
107109

108-
Note:
110+
:::{note}
109111

110112
1. When training or testing models on Windows, please ensure that all the '\\' in paths are replaced with '/'. Add .replace('\\', '/') to your python code wherever path strings occur.
111113
2. The `version+git_hash` will also be saved in trained models meta, e.g. 0.5.0+c415a2e.
@@ -114,6 +116,7 @@ Note:
114116
you can install it before installing MMCV.
115117
5. Some dependencies are optional. Simply running `pip install -e .` will only install the minimum runtime requirements.
116118
To use optional dependencies like `cityscapessripts` either install them manually with `pip install -r requirements/optional.txt` or specify desired extras when calling `pip` (e.g. `pip install -e .[optional]`). Valid keys for the extras field are: `all`, `tests`, `build`, and `optional`.
119+
:::
117120

118121
### A from-scratch setup script
119122

docs/inference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ Assume that you have already downloaded the checkpoints to the directory `checkp
6363
4 --out results.pkl --eval mIoU cityscapes
6464
```
6565

66-
Note: There is some gap (~0.1%) between cityscapes mIoU and our mIoU. The reason is that cityscapes average each class with class size by default.
66+
:::{note}
67+
There is some gap (~0.1%) between cityscapes mIoU and our mIoU. The reason is that cityscapes average each class with class size by default.
6768
We use the simple version without average for all datasets.
69+
:::
6870

6971
5. Test PSPNet on cityscapes test split with 4 GPUs, and generate the png files to be submit to the official evaluation server.
7072

docs/model_zoo.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,6 @@ The training speed is reported as followed, in terms of second per iter (s/iter)
176176
| [CASILVision](https://github.com/CSAILVision/semantic-segmentation-pytorch) | 1.15 | N/A |
177177
| [vedaseg](https://github.com/Media-Smart/vedaseg) | 0.95 | 1.25 |
178178

179-
Note: The output stride of DeepLabV3+ is 8.
179+
:::{note}
180+
The output stride of DeepLabV3+ is 8.
181+
:::

0 commit comments

Comments
 (0)