Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Add Chinese Documentation #666

Merged
merged 15 commits into from
Jul 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<br />

[![PyPI](https://img.shields.io/pypi/v/mmsegmentation)](https://pypi.org/project/mmsegmentation)
[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmsegmentation.readthedocs.io/en/latest/)
[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmsegmentation.readthedocs.io/zh_CN/latest/)
[![badge](https://github.com/open-mmlab/mmsegmentation/workflows/build/badge.svg)](https://github.com/open-mmlab/mmsegmentation/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmsegmentation/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmsegmentation)
[![license](https://img.shields.io/github/license/open-mmlab/mmsegmentation.svg)](https://github.com/open-mmlab/mmsegmentation/blob/master/LICENSE)
[![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmsegmentation.svg)](https://github.com/open-mmlab/mmsegmentation/issues)
[![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmsegmentation.svg)](https://github.com/open-mmlab/mmsegmentation/issues)

文档: https://mmsegmentation.readthedocs.io/
文档: https://mmsegmentation.readthedocs.io/zh_CN/latest

[English](README.md) | 简体中文

Expand Down Expand Up @@ -52,7 +52,7 @@ MMSegmentation 是一个基于 PyTorch 的语义分割开源工具箱。它是 O

## 基准测试和模型库

测试结果和模型可以在[模型库](docs/model_zoo.md)中找到。
测试结果和模型可以在[模型库](docs_zh-CN/model_zoo.md)中找到。

已支持的骨干网络:

Expand Down Expand Up @@ -90,13 +90,13 @@ MMSegmentation 是一个基于 PyTorch 的语义分割开源工具箱。它是 O

## 安装

请参考[快速入门文档](docs/get_started.md#installation)进行安装和数据集准备。
请参考[快速入门文档](docs_zh-CN/get_started.md#installation)进行安装和数据集准备。

## 快速入门

请参考[训练教程](docs/train.md)和[测试教程](docs/inference.md)学习 MMSegmentation 的基本使用。
我们也提供了一些进阶教程,内容覆盖了[增加自定义数据集](docs/tutorials/customize_datasets.md),[设计新的数据预处理流程](docs/tutorials/data_pipeline.md),[增加自定义模型](docs/tutorials/customize_models.md),[增加自定义的运行时配置](docs/tutorials/customize_runtime.md)。
除此之外,我们也提供了很多实用的[训练技巧说明](docs/tutorials/training_tricks.md)。
请参考[训练教程](docs_zh-CN/train.md)和[测试教程](docs_zh-CN/inference.md)学习 MMSegmentation 的基本使用。
我们也提供了一些进阶教程,内容覆盖了[增加自定义数据集](docs_zh-CN/tutorials/customize_datasets.md),[设计新的数据预处理流程](docs_zh-CN/tutorials/data_pipeline.md),[增加自定义模型](docs_zh-CN/tutorials/customize_models.md),[增加自定义的运行时配置](docs_zh-CN/tutorials/customize_runtime.md)。
除此之外,我们也提供了很多实用的[训练技巧说明](docs_zh-CN/tutorials/training_tricks.md)。

同时,我们提供了 Colab 教程。你可以在[这里](demo/MMSegmentation_Tutorial.ipynb)浏览教程,或者直接在 Colab 上[运行](https://colab.research.google.com/github/open-mmlab/mmsegmentation/blob/master/demo/MMSegmentation_Tutorial.ipynb)。

Expand Down Expand Up @@ -140,7 +140,7 @@ MMSegmentation 是一个由来自不同高校和企业的研发人员共同参
扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 OpenMMLab 团队的 [官方交流 QQ 群](https://jq.qq.com/?_wv=1027&k=aCvMxdr3)

<div align="center">
<img src="docs/imgs/zhihu_qrcode.jpg" height="400" /> <img src="docs/imgs/qq_group_qrcode.jpg" height="400" />
<img src="docs_zh-CN/imgs/zhihu_qrcode.jpg" height="400" /> <img src="docs_zh-CN/imgs/qq_group_qrcode.jpg" height="400" />
</div>

我们会在 OpenMMLab 社区为大家
Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = 'MMSegmentation'
copyright = '2020-2020, OpenMMLab'
copyright = '2020-2021, OpenMMLab'
author = 'MMSegmentation Authors'
version_file = '../mmseg/version.py'

Expand Down Expand Up @@ -79,6 +79,8 @@ def get_version():
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

language = 'zh_CN'


def builder_inited_handler(app):
subprocess.run(['./stat.py'])
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Welcome to MMSegmenation's documentation!

changelog.md

.. toctree::
:caption: Switch Language

switch_language.md

.. toctree::
:caption: API Reference

Expand Down
3 changes: 3 additions & 0 deletions docs/switch_language.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## <a href='https://mmsegmentation.readthedocs.io/en/latest/'>English</a>

## <a href='https://mmsegmentation.readthedocs.io/zh_CN/latest/'>简体中文</a>
20 changes: 20 additions & 0 deletions docs_zh-CN/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
61 changes: 61 additions & 0 deletions docs_zh-CN/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
API Reference
==============

mmseg.apis
--------------
.. automodule:: mmseg.apis
:members:

mmseg.core
--------------

seg
^^^^^^^^^^
.. automodule:: mmseg.core.seg
:members:

evaluation
^^^^^^^^^^
.. automodule:: mmseg.core.evaluation
:members:

utils
^^^^^^^^^^
.. automodule:: mmseg.core.utils
:members:

mmseg.datasets
--------------

datasets
^^^^^^^^^^
.. automodule:: mmseg.datasets
:members:

pipelines
^^^^^^^^^^
.. automodule:: mmseg.datasets.pipelines
:members:

mmseg.models
--------------

segmentors
^^^^^^^^^^
.. automodule:: mmseg.models.segmentors
:members:

backbones
^^^^^^^^^^
.. automodule:: mmseg.models.backbones
:members:

decode_heads
^^^^^^^^^^^^
.. automodule:: mmseg.models.decode_heads
:members:

losses
^^^^^^^^^^
.. automodule:: mmseg.models.losses
:members:
90 changes: 90 additions & 0 deletions docs_zh-CN/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import subprocess
import sys

sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

project = 'MMSegmentation'
copyright = '2020-2021, OpenMMLab'
author = 'MMSegmentation Authors'
version_file = '../mmseg/version.py'


def get_version():
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
return locals()['__version__']


# The full version, including alpha/beta/rc tags
release = get_version()

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'recommonmark',
'sphinx_markdown_tables',
]

autodoc_mock_imports = ['matplotlib', 'pycocotools', 'mmseg.version']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}

# The master toctree document.
master_doc = 'index'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# 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']

language = 'zh_CN'


def builder_inited_handler(app):
subprocess.run(['./stat.py'])


def setup(app):
app.connect('builder-inited', builder_inited_handler)
Loading