[Docs] Use PyTorch style docs theme (#457)

* Change docs theme to pytorch-theme

* Update docs rst

* Fix docs title level.

* Add static resources

* Fix lint
pull/471/head
Ma Zerun 2021-09-23 22:21:03 +08:00 committed by GitHub
parent 0b20aa6873
commit 1d6d142b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 443 additions and 90 deletions

View File

@ -0,0 +1,6 @@
.header-logo {
background-image: url("../image/mmcls-logo.png");
background-size: 204px 40px;
height: 40px;
width: 204px;
}

BIN
docs/_static/image/mmcls-logo.png vendored 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,6 +1,3 @@
API Reference
=============
mmcls.apis
-------------
.. automodule:: mmcls.apis

View File

@ -1,19 +1,19 @@
## Changelog
# Changelog
### v0.15.0(31/8/2021)
## v0.15.0(31/8/2021)
#### Highlights
### Highlights
- Support `hparams` argument in `AutoAugment` and `RandAugment` to provide hyperparameters for sub-policies.
- Support custom squeeze channels in `SELayer`.
- Support classwise weight in losses.
#### New Features
### New Features
- Add `hparams` argument in `AutoAugment` and `RandAugment` and some other improvement. ([#398](https://github.com/open-mmlab/mmclassification/pull/398))
- Support classwise weight in losses. ([#388](https://github.com/open-mmlab/mmclassification/pull/388))
- Enhence `SELayer` to support custom squeeze channels. ([#417](https://github.com/open-mmlab/mmclassification/pull/417))
#### Code Refactor
### Code Refactor
- Better result visualization. ([#419](https://github.com/open-mmlab/mmclassification/pull/419))
- Use `post_process` function to handle pred result processing. ([#390](https://github.com/open-mmlab/mmclassification/pull/390))
@ -22,7 +22,7 @@
- Avoid unnecessary listdir when building ImageNet. ([#396](https://github.com/open-mmlab/mmclassification/pull/396))
- Use dynamic mmcv download link in TorchServe dockerfile. ([#387](https://github.com/open-mmlab/mmclassification/pull/387))
#### Docs Improvement
### Docs Improvement
- Add readme of some algorithms and update meta yml. ([#418](https://github.com/open-mmlab/mmclassification/pull/418))
- Add Copyright information. ([#413](https://github.com/open-mmlab/mmclassification/pull/413))
@ -30,21 +30,21 @@
- Update QQ group QR code. ([#393](https://github.com/open-mmlab/mmclassification/pull/393))
- Add PR template and modify issue template. ([#380](https://github.com/open-mmlab/mmclassification/pull/380))
### v0.14.0(4/8/2021)
## v0.14.0(4/8/2021)
#### Highlights
### Highlights
- Add transformer-in-transformer backbone and pretrain checkpoints, refers to [the paper](https://arxiv.org/abs/2103.00112).
- Add Chinese colab tutorial.
- Provide dockerfile to build mmcls dev docker image.
#### New Features
### New Features
- Add transformer in transformer backbone and pretrain checkpoints. ([#339](https://github.com/open-mmlab/mmclassification/pull/339))
- Support mim, welcome to use mim to manage your mmcls project. ([#376](https://github.com/open-mmlab/mmclassification/pull/376))
- Add Dockerfile. ([#365](https://github.com/open-mmlab/mmclassification/pull/365))
- Add ResNeSt configs. ([#332](https://github.com/open-mmlab/mmclassification/pull/332))
#### Improvements
### Improvements
- Use the `presistent_works` option if available, to accelerate training. ([#349](https://github.com/open-mmlab/mmclassification/pull/349))
- Add Chinese ipynb tutorial. ([#306](https://github.com/open-mmlab/mmclassification/pull/306))
@ -52,7 +52,7 @@
- Support to test mmdet inference with mmcls backbone. ([#343](https://github.com/open-mmlab/mmclassification/pull/343))
- Use zero as default value of `thrs` in metrics. ([#341](https://github.com/open-mmlab/mmclassification/pull/341))
#### Bug Fixes
### Bug Fixes
- Fix ImageNet dataset annotation file parse bug. ([#370](https://github.com/open-mmlab/mmclassification/pull/370))
- Fix docstring typo and init bug in ShuffleNetV1. ([#374](https://github.com/open-mmlab/mmclassification/pull/374))
@ -63,11 +63,11 @@
- Fix broken `_base_` link in a resnet config. ([#361](https://github.com/open-mmlab/mmclassification/pull/361))
- Fix vgg-19 model link missing. ([#363](https://github.com/open-mmlab/mmclassification/pull/363))
### v0.13.0(3/7/2021)
## v0.13.0(3/7/2021)
- Support Swin-Transformer backbone and add training configs for Swin-Transformer on ImageNet.
#### New Features
### New Features
- Support Swin-Transformer backbone and add training configs for Swin-Transformer on ImageNet. (#271)
- Add pretained model of RegNetX. (#269)
@ -76,7 +76,7 @@
- Dump config before training. (#282)
- Add torchscript and torchserve deployment tools. (#279, #284)
#### Improvements
### Improvements
- Improve test tools and add some new tools. (#322)
- Correct MobilenetV3 backbone structure and add pretained models. (#291)
@ -85,7 +85,7 @@
- Refactor weights initialization method. (#270, #318, #319)
- Refactor `LabelSmoothLoss` to support multiple calculation formulas. (#285)
#### Bug Fixes
### Bug Fixes
- Fix bug for CPU training. (#286)
- Fix missing test data when `num_imgs` can not be evenly divided by `num_gpus`. (#299)
@ -93,47 +93,47 @@
- Fix `magnitude_std` bug in `RandAugment`. (#309)
- Fix bug when `samples_per_gpu` is 1. (#311)
### v0.12.0(3/6/2021)
## v0.12.0(3/6/2021)
- Finish adding Chinese tutorials and build Chinese documentation on readthedocs.
- Update ResNeXt checkpoints and ResNet checkpoints on CIFAR.
#### New Features
### New Features
- Improve and add Chinese translation of `data_pipeline.md` and `new_modules.md`. (#265)
- Build Chinese translation on readthedocs. (#267)
- Add an argument efficientnet_style to `RandomResizedCrop` and `CenterCrop`. (#268)
#### Improvements
### Improvements
- Only allow directory operation when rank==0 when testing. (#258)
- Fix typo in `base_head`. (#274)
- Update ResNeXt checkpoints. (#283)
#### Bug Fixes
### Bug Fixes
- Add attribute `data.test` in MNIST configs. (#264)
- Download CIFAR/MNIST dataset only on rank 0. (#273)
- Fix MMCV version compatibility. (#276)
- Fix CIFAR color channels bug and update checkpoints in model zoo. (#280)
### v0.11.1(21/5/2021)
## v0.11.1(21/5/2021)
- Refine `new_dataset.md` and add Chinese translation of `finture.md`, `new_dataset.md`.
#### New Features
### New Features
- Add `dim` argument for `GlobalAveragePooling`. (#236)
- Add random noise to `RandAugment` magnitude. (#240)
- Refine `new_dataset.md` and add Chinese translation of `finture.md`, `new_dataset.md`. (#243)
#### Improvements
### Improvements
- Refactor arguments passing for Heads. (#239)
- Allow more flexible `magnitude_range` in `RandAugment`. (#249)
- Inherits MMCV registry so that in the future OpenMMLab repos like MMDet and MMSeg could directly use the backbones supported in MMCls. (#252)
#### Bug Fixes
### Bug Fixes
- Fix typo in `analyze_results.py`. (#237)
- Fix typo in unittests. (#238)
@ -141,7 +141,7 @@
- Add missing config files in `MANIFEST.in`. (#250 & #255)
- Use temporary directory under shared directory to collect results to avoid unavailability of temporary directory for multi-node testing. (#251)
### v0.11.0(1/5/2021)
## v0.11.0(1/5/2021)
- Support cutmix trick.
- Support random augmentation.
@ -149,7 +149,7 @@
- Support ViT backbone and add training configs for ViT on ImageNet.
- Add Chinese `README.md` and some Chinese tutorials.
#### New Features
### New Features
- Support cutmix trick. (#198)
- Add `simplify` option in `pytorch2onnx.py`. (#200)
@ -163,7 +163,7 @@
- Add `metafile.yml` in configs to support interaction with paper with code(PWC) and MMCLI. (#225)
- Upload configs and converted checkpoints for ViT fintuning on ImageNet. (#230)
#### Improvements
### Improvements
- Fix `LabelSmoothLoss` so that label smoothing and mixup could be enabled at the same time. (#203)
- Add `cal_acc` option in `ClsHead`. (#206)
@ -175,17 +175,17 @@
- Reformat `pytorch2onnx.md` tutorial. (#229)
- Update `setup.py` to support MMCLI. (#232)
#### Bug Fixes
### Bug Fixes
- Fix missing `cutmix_prob` in ViT configs. (#220)
- Fix backend for resize in ResNeXt configs. (#222)
### v0.10.0(1/4/2021)
## v0.10.0(1/4/2021)
- Support AutoAugmentation
- Add tutorials for installation and usage.
#### New Features
### New Features
- Add `Rotate` pipeline for data augmentation. (#167)
- Add `Invert` pipeline for data augmentation. (#168)
@ -195,44 +195,44 @@
- Add tutorials for installation and basic usage of MMClassification.(#176)
- Support `AutoAugmentation`, `AutoContrast`, `Equalize`, `Contrast`, `Brightness` and `Sharpness` pipelines for data augmentation. (#179)
#### Improvements
### Improvements
- Support dynamic shape export to onnx. (#175)
- Release training configs and update model zoo for fp16 (#184)
- Use MMCV's EvalHook in MMClassification (#182)
#### Bug Fixes
### Bug Fixes
- Fix wrong naming in vgg config (#181)
### v0.9.0(1/3/2021)
## v0.9.0(1/3/2021)
- Implement mixup trick.
- Add a new tool to create TensorRT engine from ONNX, run inference and verify outputs in Python.
#### New Features
### New Features
- Implement mixup and provide configs of training ResNet50 using mixup. (#160)
- Add `Shear` pipeline for data augmentation. (#163)
- Add `Translate` pipeline for data augmentation. (#165)
- Add `tools/onnx2tensorrt.py` as a tool to create TensorRT engine from ONNX, run inference and verify outputs in Python. (#153)
#### Improvements
### Improvements
- Add `--eval-options` in `tools/test.py` to support eval options override, matching the behavior of other open-mmlab projects. (#158)
- Support showing and saving painted results in `mmcls.apis.test` and `tools/test.py`, matching the behavior of other open-mmlab projects. (#162)
#### Bug Fixes
### Bug Fixes
- Fix configs for VGG, replace checkpoints converted from other repos with the ones trained by ourselves and upload the missing logs in the model zoo. (#161)
### v0.8.0(31/1/2021)
## v0.8.0(31/1/2021)
- Support multi-label task.
- Support more flexible metrics settings.
- Fix bugs.
#### New Features
### New Features
- Add evaluation metrics: mAP, CP, CR, CF1, OP, OR, OF1 for multi-label task. (#123)
- Add BCE loss for multi-label task. (#130)
@ -245,7 +245,7 @@
- Add thresholds in eval_metrics. (#146)
- Add heads and a baseline config for multilabel task. (#145)
#### Improvements
### Improvements
- Remove the models with 0 checkpoint and ignore the repeated papers when counting papers to gain more accurate model statistics. (#135)
- Add tags in README.md. (#137)
@ -254,25 +254,25 @@
- Fix mismatched columns in README.md. (#150)
- Fix test.py to support more evaluation metrics. (#155)
#### Bug Fixes
### Bug Fixes
- Fix bug in VGG weight_init. (#140)
- Fix bug in 2 ResNet configs in which outdated heads were used. (#147)
- Fix bug of misordered height and width in `RandomCrop` and `RandomResizedCrop`. (#151)
- Fix missing `meta_keys` in `Collect`. (#149 & #152)
### v0.7.0(31/12/2020)
## v0.7.0(31/12/2020)
- Add more evaluation metrics.
- Fix bugs.
#### New Features
### New Features
- Remove installation of MMCV from requirements. (#90)
- Add 3 evaluation metrics: precision, recall and F-1 score. (#93)
- Allow config override during testing and inference with `--options`. (#91 & #96)
#### Improvements
### Improvements
- Use `build_runner` to make runners more flexible. (#54)
- Support to get category ids in `BaseDataset`. (#72)
@ -286,7 +286,7 @@
- Add model statistics. (#119)
- Refactor documentation in consistency with other MM repositories. (#126)
#### Bug Fixes
### Bug Fixes
- Add missing `CLASSES` argument to dataset wrappers. (#66)
- Fix slurm evaluation error during training. (#69)
@ -295,13 +295,13 @@
- Fix bug in `gpu_ids` in distributed training. (#107)
- Fix bug caused by extremely insufficient data in collect results during testing (#114)
### v0.6.0(11/10/2020)
## v0.6.0(11/10/2020)
- Support new method: ResNeSt and VGG.
- Support new dataset: CIFAR10.
- Provide new tools to do model inference, model conversion from pytorch to onnx.
#### New Features
### New Features
- Add model inference. (#16)
- Add pytorch2onnx. (#20)
@ -312,14 +312,14 @@
- Add albumentations transforms. (#45)
- Visualize results on image demo. (#58)
#### Improvements
### Improvements
- Replace urlretrieve with urlopen in dataset.utils. (#13)
- Resize image according to its short edge. (#22)
- Update ShuffleNet config. (#31)
- Update pre-trained models for shufflenet_v2, shufflenet_v1, se-resnet50, se-resnet101. (#33)
#### Bug Fixes
### Bug Fixes
- Fix init_weights in `shufflenet_v2.py`. (#29)
- Fix the parameter `size` in test_pipeline. (#30)

View File

@ -14,6 +14,11 @@ import os
import subprocess
import sys
import pytorch_sphinx_theme
from m2r import MdInclude
from recommonmark.transform import AutoStructify
from sphinx.builders.html import StandaloneHTMLBuilder
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
@ -42,8 +47,9 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'recommonmark',
'sphinx_markdown_tables',
'myst_parser',
'sphinx_copybutton',
]
autodoc_mock_imports = ['matplotlib', 'mmcls.version', 'mmcv.ops']
@ -65,17 +71,117 @@ source_suffix = {
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = 'pytorch_sphinx_theme'
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# 'logo_url': 'https://mmocr.readthedocs.io/en/latest/',
'menu': [
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/mmcv'
},
{
'name':
'Projects',
'children': [
{
'name': 'MMAction2',
'url': 'https://github.com/open-mmlab/mmaction2',
},
{
'name': 'MMClassification',
'url': 'https://github.com/open-mmlab/mmclassification',
},
{
'name': 'MMDetection',
'url': 'https://github.com/open-mmlab/mmdetection',
},
{
'name': 'MMDetection3D',
'url': 'https://github.com/open-mmlab/mmdetection3d',
},
{
'name': 'MMEditing',
'url': 'https://github.com/open-mmlab/mmediting',
},
{
'name': 'MMGeneration',
'url': 'https://github.com/open-mmlab/mmgeneration',
},
{
'name': 'MMOCR',
'url': 'https://github.com/open-mmlab/mmocr',
},
{
'name': 'MMPose',
'url': 'https://github.com/open-mmlab/mmpose',
},
{
'name': 'MMSegmentation',
'url': 'https://github.com/open-mmlab/mmsegmentation',
},
{
'name': 'MMTracking',
'url': 'https://github.com/open-mmlab/mmtracking',
},
]
},
{
'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_static_path = ['_static']
html_css_files = ['css/readthedocs.css']
master_doc = 'index'
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'mmclsdoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
'preamble':
r'''
@ -96,10 +202,72 @@ latex_elements = {
''',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'mmcls.tex', 'MMClassification Documentation',
'MMClassification Contributors', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'mmcls', 'MMClassification Documentation', [author],
1)]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'mmcls', 'MMClassification Documentation', author, 'mmcls',
'One line description of project.', 'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# set priority when building html
StandaloneHTMLBuilder.supported_image_types = [
'image/svg+xml', 'image/gif', 'image/png', 'image/jpeg'
]
# -- Extension configuration -------------------------------------------------
# Ignore >>> when copying code
copybutton_prompt_text = r'>>> |\.\.\. '
copybutton_prompt_is_regexp = True
def builder_inited_handler(app):
subprocess.run(['./stat.py'])
def setup(app):
app.add_config_value('no_underscore_emphasis', False, 'env')
app.add_config_value('m2r_parse_relative_links', False, 'env')
app.add_config_value('m2r_anonymous_references', False, 'env')
app.add_config_value('m2r_disable_inline_math', False, 'env')
app.add_directive('mdinclude', MdInclude)
app.add_config_value('recommonmark_config', {
'auto_toc_tree_section': 'Contents',
'enable_eval_rst': True,
}, True)
app.add_transform(AutoStructify)
app.connect('builder-inited', builder_inited_handler)

View File

@ -6,7 +6,7 @@ You can switch between Chinese and English documents in the lower-left corner of
您可以在页面左下角切换中英文文档。
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Get Started
install.md
@ -14,14 +14,14 @@ You can switch between Chinese and English documents in the lower-left corner of
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Model zoo
modelzoo_statistics.md
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Tutorials
tutorials/finetune.md
@ -31,7 +31,7 @@ You can switch between Chinese and English documents in the lower-left corner of
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Useful Tools and Scripts
tools/pytorch2onnx.md

View File

@ -1,6 +1,6 @@
## Installation
# Installation
### Requirements
## Requirements
- Python 3.6+
- PyTorch 1.3+
@ -27,7 +27,7 @@ Note: Since the `master` branch is under frequent development, the `mmcv`
version dependency may be inaccurate. If you encounter problems when using
the `master` branch, please try to update `mmcv` to the latest version.
### Install MMClassification
## Install MMClassification
a. Create a conda virtual environment and activate it.
@ -64,7 +64,7 @@ you can use more CUDA versions such as 9.0.
c. Install MMClassification repository.
#### Release version
### Release version
We recommend you to install MMClassification with [MIM](https://github.com/open-mmlab/mim).
@ -82,7 +82,7 @@ Or, you can install MMClassification with pip:
pip install mmcls
```
#### Develop version
### Develop version
First, clone the MMClassification repository.
@ -105,9 +105,9 @@ Note:
you can install it before installing [mmcv](https://github.com/open-mmlab/mmcv).
#### Another option: Docker Image
### Another option: Docker Image
We provide a [Dockerfile](/docker/Dockerfile) to build an image.
We provide a [Dockerfile](https://github.com/open-mmlab/mmclassification/blob/master/docker/Dockerfile) to build an image.
```shell
# build an image with PyTorch 1.6.0, CUDA 10.1, CUDNN 7.
@ -122,7 +122,7 @@ Run a container built from mmcls image with command:
docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/workspace/mmclassification/data mmcls:torch1.6.0-cuda10.1-cudnn7 /bin/bash
```
### Using multiple MMClassification versions
## Using multiple MMClassification versions
The train and test scripts already modify the `PYTHONPATH` to ensure the script use the MMClassification in the current directory.

View File

@ -1,3 +1,3 @@
## <a href='https://mmclassification.readthedocs.io/en/latest/'>English</a>
# <a href='https://mmclassification.readthedocs.io/en/latest/'>English</a>
## <a href='https://mmclassification.readthedocs.io/zh_CN/latest/'>简体中文</a>
# <a href='https://mmclassification.readthedocs.io/zh_CN/latest/'>简体中文</a>

View File

@ -0,0 +1,6 @@
.header-logo {
background-image: url("../image/mmcls-logo.png");
background-size: 204px 40px;
height: 40px;
width: 204px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,6 +1,3 @@
API Reference
=============
mmcls.apis
-------------
.. automodule:: mmcls.apis

View File

@ -14,6 +14,11 @@ import os
import subprocess
import sys
import pytorch_sphinx_theme
from m2r import MdInclude
from recommonmark.transform import AutoStructify
from sphinx.builders.html import StandaloneHTMLBuilder
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
@ -42,8 +47,9 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'recommonmark',
'sphinx_markdown_tables',
'myst_parser',
'sphinx_copybutton',
]
autodoc_mock_imports = ['matplotlib', 'mmcls.version', 'mmcv.ops']
@ -65,21 +71,192 @@ source_suffix = {
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = 'pytorch_sphinx_theme'
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# 'logo_url': 'https://mmocr.readthedocs.io/en/latest/',
'menu': [
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/mmcv'
},
{
'name':
'算法库',
'children': [
{
'name': 'MMAction2',
'url': 'https://github.com/open-mmlab/mmaction2',
},
{
'name': 'MMClassification',
'url': 'https://github.com/open-mmlab/mmclassification',
},
{
'name': 'MMDetection',
'url': 'https://github.com/open-mmlab/mmdetection',
},
{
'name': 'MMDetection3D',
'url': 'https://github.com/open-mmlab/mmdetection3d',
},
{
'name': 'MMEditing',
'url': 'https://github.com/open-mmlab/mmediting',
},
{
'name': 'MMGeneration',
'url': 'https://github.com/open-mmlab/mmgeneration',
},
{
'name': 'MMOCR',
'url': 'https://github.com/open-mmlab/mmocr',
},
{
'name': 'MMPose',
'url': 'https://github.com/open-mmlab/mmpose',
},
{
'name': 'MMSegmentation',
'url': 'https://github.com/open-mmlab/mmsegmentation',
},
{
'name': 'MMTracking',
'url': 'https://github.com/open-mmlab/mmtracking',
},
]
},
{
'name':
'OpenMMLab',
'children': [
{
'name': '官网',
'url': 'https://openmmlab.com/'
},
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/'
},
{
'name': '推特',
'url': 'https://twitter.com/OpenMMLab'
},
{
'name': '知乎',
'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_static_path = ['_static']
html_css_files = ['css/readthedocs.css']
language = 'zh_CN'
master_doc = 'index'
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'mmclsdoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'mmcls.tex', 'MMClassification Documentation',
'MMClassification Contributors', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'mmcls', 'MMClassification Documentation', [author],
1)]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'mmcls', 'MMClassification Documentation', author, 'mmcls',
'One line description of project.', 'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# set priority when building html
StandaloneHTMLBuilder.supported_image_types = [
'image/svg+xml', 'image/gif', 'image/png', 'image/jpeg'
]
# -- Extension configuration -------------------------------------------------
# Ignore >>> when copying code
copybutton_prompt_text = r'>>> |\.\.\. '
copybutton_prompt_is_regexp = True
def builder_inited_handler(app):
subprocess.run(['./stat.py'])
def setup(app):
app.add_config_value('no_underscore_emphasis', False, 'env')
app.add_config_value('m2r_parse_relative_links', False, 'env')
app.add_config_value('m2r_anonymous_references', False, 'env')
app.add_config_value('m2r_disable_inline_math', False, 'env')
app.add_directive('mdinclude', MdInclude)
app.add_config_value('recommonmark_config', {
'auto_toc_tree_section': 'Contents',
'enable_eval_rst': True,
}, True)
app.add_transform(AutoStructify)
app.connect('builder-inited', builder_inited_handler)

View File

@ -6,7 +6,7 @@ You can switch between Chinese and English documents in the lower-left corner of
您可以在页面左下角切换中英文文档。
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: 开始你的第一步
install.md
@ -14,14 +14,14 @@ You can switch between Chinese and English documents in the lower-left corner of
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: 模型库
modelzoo_statistics.md
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: 教程
tutorials/finetune.md
@ -31,7 +31,7 @@ You can switch between Chinese and English documents in the lower-left corner of
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: 实用工具
tools/pytorch2onnx.md

View File

@ -1,6 +1,6 @@
## 安装
# 安装
### 安装依赖包
## 安装依赖包
- Python 3.6+
- PyTorch 1.3+
@ -26,7 +26,7 @@ MMClassification 和 MMCV 的适配关系如下,请安装正确版本的 MMCV
提示:由于 `master` 分支处于频繁开发中,`mmcv` 版本依赖可能不准确。如果您在使用
`master` 分支时遇到问题,请尝试更新 `mmcv` 到最新版。
### 安装 MMClassification 步骤
## 安装 MMClassification 步骤
a. 创建 conda 虚拟环境,并激活
@ -62,7 +62,7 @@ conda install pytorch=1.3.1 cudatoolkit=9.2 torchvision=0.4.2 -c pytorch
c. 安装 MMClassification 库
#### 稳定版本
### 稳定版本
我们推荐使用 [MIM](https://github.com/open-mmlab/mim) 进行 MMClassification 的安装。
@ -79,7 +79,7 @@ MIM 工具可以自动安装 OpenMMLab 旗下的各个项目及其依赖,同
pip install mmcls
```
#### 开发版本
### 开发版本
首先,克隆最新的 MMClassification 仓库:
@ -100,9 +100,9 @@ pip install -e . # 或者 "python setup.py develop"
2. 如果希望使用 `opencv-python-headless` 而不是 `opencv-python`,可以在安装 [mmcv](https://github.com/open-mmlab/mmcv) 之前提前安装。
#### 利用 Docker 镜像安装 MMClassification
### 利用 Docker 镜像安装 MMClassification
MMClassification 提供 [Dockerfile](/docker/Dockerfile) ,可以通过以下命令创建 docker 镜像。
MMClassification 提供 [Dockerfile](https://github.com/open-mmlab/mmclassification/blob/master/docker/Dockerfile) ,可以通过以下命令创建 docker 镜像。
```shell
# 创建基于 PyTorch 1.6.0, CUDA 10.1, CUDNN 7 的镜像。
@ -117,7 +117,7 @@ docker build -f ./docker/Dockerfile --rm -t mmcls:torch1.6.0-cuda10.1-cudnn7 .
docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/workspace/mmclassification/data mmcls:torch1.6.0-cuda10.1-cudnn7 /bin/bash
```
### 在多个 MMClassification 版本下进行开发
## 在多个 MMClassification 版本下进行开发
MMClassification 的训练和测试脚本已经修改了 `PYTHONPATH` 变量,以确保其能够运行当前目录下的 MMClassification。

View File

@ -1,3 +1,3 @@
## <a href='https://mmclassification.readthedocs.io/en/latest/'>English</a>
# <a href='https://mmclassification.readthedocs.io/en/latest/'>English</a>
## <a href='https://mmclassification.readthedocs.io/zh_CN/latest/'>简体中文</a>
# <a href='https://mmclassification.readthedocs.io/zh_CN/latest/'>简体中文</a>

View File

@ -1,5 +1,7 @@
docutils==0.16.0
recommonmark
m2r
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
sphinx_rtd_theme==0.5.2

View File

@ -14,6 +14,6 @@ line_length = 79
multi_line_output = 0
known_standard_library = pkg_resources,setuptools
known_first_party = mmcls
known_third_party = PIL,matplotlib,mmcv,mmdet,numpy,onnxruntime,packaging,pytest,seaborn,torch,torchvision,ts
known_third_party = PIL,m2r,matplotlib,mmcv,mmdet,numpy,onnxruntime,packaging,pytest,pytorch_sphinx_theme,recommonmark,seaborn,sphinx,torch,torchvision,ts
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY