Skip to content

Commit

Permalink
Add chinese doc base (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjiarui authored Jun 9, 2021
1 parent 5d46314 commit 194c1c9
Show file tree
Hide file tree
Showing 26 changed files with 700 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 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
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://mmdetection.readthedocs.io/en/latest/'>English</a>

## <a href='https://mmdetection.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)
1 change: 1 addition & 0 deletions docs_zh-CN/dataset_prepare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 准备数据集
1 change: 1 addition & 0 deletions docs_zh-CN/get_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 依赖
File renamed without changes
File renamed without changes
62 changes: 62 additions & 0 deletions docs_zh-CN/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
欢迎来到 MMSegmenation 的文档!
=======================================

.. toctree::
:maxdepth: 2
:caption: 开始你的第一步

get_started.md

.. toctree::
:maxdepth: 1
:caption: 数据集准备

dataset_prepare.md

.. toctree::
:maxdepth: 1
:caption: 模型库

model_zoo.md
modelzoo_statistics.md

.. toctree::
:maxdepth: 2
:caption: 快速启动

train.md
inference.md

.. toctree::
:maxdepth: 2
:caption: 教程

tutorials/index.rst

.. toctree::
:maxdepth: 2
:caption: 实用工具与脚本

useful_tools.md

.. toctree::
:maxdepth: 2
:caption: 说明

changelog.md

.. toctree::
:caption: 语言切换

switch_language.md

.. toctree::
:caption: 接口文档(英文)

api.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`search`
1 change: 1 addition & 0 deletions docs_zh-CN/inference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 用预训练模型进行推理
35 changes: 35 additions & 0 deletions docs_zh-CN/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading

0 comments on commit 194c1c9

Please sign in to comment.