mirror of https://github.com/open-mmlab/mmcv.git
[Docs] Use myst parser (#1287)
* add myst-parser extension for sphinx * make note style more beautifulpull/1183/merge
parent
259ea5f63f
commit
aa64ee6a7c
docs
docs_zh_CN
get_started
requirements
|
@ -12,8 +12,9 @@ All kinds of contributions are welcome, including but not limited to the followi
|
|||
3. commit your changes
|
||||
4. create a PR
|
||||
|
||||
Note: If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
|
||||
|
||||
```{note}
|
||||
If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
|
||||
```
|
||||
### Code style
|
||||
|
||||
#### Python
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
git checkout -b branchname
|
||||
```
|
||||
|
||||
NOTE: To make commit history clear, we strongly recommend you checkout the master branch before create a new branch.
|
||||
```{tip}
|
||||
To make commit history clear, we strongly recommend you checkout the master branch before create a new branch.
|
||||
```
|
||||
|
||||
3. Commit your changes
|
||||
```bash
|
||||
|
|
|
@ -49,9 +49,9 @@ extensions = [
|
|||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.viewcode',
|
||||
'recommonmark',
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'sphinx_markdown_tables'
|
||||
'sphinx_markdown_tables',
|
||||
'myst_parser',
|
||||
] # yapf: disable
|
||||
|
||||
autodoc_mock_imports = ['mmcv._ext', 'mmcv.utils.ext_loader', 'torchvision']
|
||||
|
|
|
@ -35,10 +35,11 @@ e.g.,
|
|||
CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .
|
||||
```
|
||||
|
||||
Note: If you would like to use `opencv-python-headless` instead of `opencv-python`,
|
||||
```{note}
|
||||
If you would like to use `opencv-python-headless` instead of `opencv-python`,
|
||||
e.g., in a minimum container environment or servers without GUI,
|
||||
you can first install it before installing MMCV to skip the installation of `opencv-python`.
|
||||
|
||||
```
|
||||
### Build on Windows
|
||||
|
||||
Building MMCV on Windows is a bit more complicated than that on Linux.
|
||||
|
@ -203,7 +204,9 @@ pip list
|
|||
$env:TORCH_CUDA_ARCH_LIST="3.5 3.7 5.0 5.2 6.0 6.1 7.0 7.5"
|
||||
```
|
||||
|
||||
Note: Check your the compute capability of your GPU from [here](https://developer.nvidia.com/cuda-gpus).
|
||||
```{note}
|
||||
Check your the compute capability of your GPU from [here](https://developer.nvidia.com/cuda-gpus).
|
||||
```
|
||||
|
||||
1. Launch compiling the same way as CPU
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@ There are two versions of MMCV:
|
|||
- **mmcv-full**: comprehensive, with full features and various CUDA ops out of box. It takes longer time to build.
|
||||
- **mmcv**: lite, without CUDA ops but all other features, similar to mmcv<1.0.0. It is useful when you do not need those CUDA ops.
|
||||
|
||||
**Note**: Do not install both versions in the same environment, otherwise you may encounter errors like `ModuleNotFound`. You need to uninstall one before installing the other. `Installing the full verion is highly recommended if CUDA is avaliable`.
|
||||
```{warning}
|
||||
Do not install both versions in the same environment, otherwise you may encounter errors like `ModuleNotFound`. You need to uninstall one before installing the other. `Installing the full verion is highly recommended if CUDA is avaliable`.
|
||||
```
|
||||
|
||||
a. Install the full version.
|
||||
|
||||
|
|
|
@ -28,4 +28,6 @@ It provides the following functionalities.
|
|||
- Various CNN architectures
|
||||
- High-quality implementation of common CUDA ops
|
||||
|
||||
Note: MMCV requires Python 3.6+.
|
||||
```{note}
|
||||
MMCV requires Python 3.6+.
|
||||
```
|
||||
|
|
|
@ -85,9 +85,11 @@ def build_converter(cfg, registry, *args, **kwargs):
|
|||
CONVERTERS = Registry('converter', build_func=build_converter)
|
||||
```
|
||||
|
||||
Note: in this example, we demonstrate how to use the `build_func` argument to customize the way to build a class instance.
|
||||
```{note}
|
||||
In this example, we demonstrate how to use the `build_func` argument to customize the way to build a class instance.
|
||||
The functionality is similar to the default `build_from_cfg`. In most cases, default one would be sufficient.
|
||||
`build_model_from_cfg` is also implemented to build PyTorch module in `nn.Sequentail`, you may directly use them instead of implementing by yourself.
|
||||
```
|
||||
|
||||
### Hierarchy Registry
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@ extensions = [
|
|||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.viewcode',
|
||||
'recommonmark',
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'sphinx_markdown_tables'
|
||||
'sphinx_markdown_tables',
|
||||
'myst_parser',
|
||||
] # yapf: disable
|
||||
|
||||
autodoc_mock_imports = ['mmcv._ext', 'mmcv.utils.ext_loader', 'torchvision']
|
||||
|
|
|
@ -31,4 +31,6 @@ MMCV 提供了如下众多功能:
|
|||
|
||||
如想了解更多特性和使用,请参考[文档](https://mmcv.readthedocs.io/zh_CN/latest)。
|
||||
|
||||
提示: MMCV 需要 Python 3.6 以上版本。
|
||||
```{note}
|
||||
MMCV 需要 Python 3.6 以上版本。
|
||||
```
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
m2r
|
||||
myst-parser
|
||||
opencv-python
|
||||
sphinx
|
||||
sphinx_markdown_tables
|
||||
|
|
Loading…
Reference in New Issue