From 8118d76a4ff609d5826bb5d758aebdd092d03392 Mon Sep 17 00:00:00 2001 From: Kai Chen <chenkaidev@gmail.com> Date: Tue, 24 Dec 2019 18:06:04 +0800 Subject: [PATCH] Add sphinx generated docs (#1859) * use sphinx to generate docs * fix flake8 linting * update docs --- README.md | 2 + docs/DATA_PIPELINE.md | 115 --------------------------------- docs/GETTING_STARTED.md | 18 +++--- docs/INSTALL.md | 38 +++++++---- docs/MODEL_ZOO.md | 34 +++++----- docs/Makefile | 20 ++++++ docs/TECHNICAL_DETAILS.md | 130 ++++++++++++++++++++++++++++++++++++-- docs/conf.py | 67 ++++++++++++++++++++ docs/index.rst | 19 ++++++ docs/make.bat | 35 ++++++++++ docs/requirements.txt | 4 ++ 11 files changed, 324 insertions(+), 158 deletions(-) delete mode 100644 docs/DATA_PIPELINE.md create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt diff --git a/README.md b/README.md index f8a667a..9618cd9 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ **News**: We released the technical report on [ArXiv](https://arxiv.org/abs/1906.07155). +Documentation: https://mmdetection.readthedocs.io/ + ## Introduction The master branch works with **PyTorch 1.1** or higher. diff --git a/docs/DATA_PIPELINE.md b/docs/DATA_PIPELINE.md deleted file mode 100644 index 413463a..0000000 --- a/docs/DATA_PIPELINE.md +++ /dev/null @@ -1,115 +0,0 @@ -## Data preparation pipeline - -The data preparation pipeline and the dataset is decomposed. Usually a dataset -defines how to process the annotations and a data pipeline defines all the steps to prepare a data dict. -A pipeline consists of a sequence of operations. Each operation takes a dict as input and also output a dict for the next transform. - -We present a classical pipeline in the following figure. The blue blocks are pipeline operations. With the pipeline going on, each operator can add new keys (marked as green) to the result dict or update the existing keys (marked as orange). - - -The operations are categorized into data loading, pre-processing, formatting and test-time augmentation. - -Here is an pipeline example for Faster R-CNN. -```python -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) -train_pipeline = [ - dict(type='LoadImageFromFile'), - dict(type='LoadAnnotations', with_bbox=True), - dict(type='Resize', img_scale=(1333, 800), keep_ratio=True), - dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']), -] -test_pipeline = [ - dict(type='LoadImageFromFile'), - dict( - type='MultiScaleFlipAug', - img_scale=(1333, 800), - flip=False, - transforms=[ - dict(type='Resize', keep_ratio=True), - dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) -] -``` - -For each operation, we list the related dict fields that are added/updated/removed. - -### Data loading - -`LoadImageFromFile` -- add: img, img_shape, ori_shape - -`LoadAnnotations` -- add: gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg, bbox_fields, mask_fields - -`LoadProposals` -- add: proposals - -### Pre-processing - -`Resize` -- add: scale, scale_idx, pad_shape, scale_factor, keep_ratio -- update: img, img_shape, *bbox_fields, *mask_fields - -`RandomFlip` -- add: flip -- update: img, *bbox_fields, *mask_fields - -`Pad` -- add: pad_fixed_size, pad_size_divisor -- update: img, pad_shape, *mask_fields - -`RandomCrop` -- update: img, pad_shape, gt_bboxes, gt_labels, gt_masks, *bbox_fields - -`Normalize` -- add: img_norm_cfg -- update: img - -`SegResizeFlipPadRescale` -- update: gt_semantic_seg - -`PhotoMetricDistortion` -- update: img - -`Expand` -- update: img, gt_bboxes - -`MinIoURandomCrop` -- update: img, gt_bboxes, gt_labels - -`Corrupt` -- update: img - -### Formatting - -`ToTensor` -- update: specified by `keys`. - -`ImageToTensor` -- update: specified by `keys`. - -`Transpose` -- update: specified by `keys`. - -`ToDataContainer` -- update: specified by `fields`. - -`DefaultFormatBundle` -- update: img, proposals, gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg - -`Collect` -- add: img_meta (the keys of img_meta is specified by `meta_keys`) -- remove: all other keys except for those specified by `keys` - -### Test time augmentation - -`MultiScaleFlipAug` \ No newline at end of file diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index b07d90d..92c08dc 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -102,7 +102,7 @@ for frame in video: show_result(frame, result, model.CLASSES, wait_time=1) ``` -A notebook demo can be found in [demo/inference_demo.ipynb](../demo/inference_demo.ipynb). +A notebook demo can be found in [demo/inference_demo.ipynb](https://github.com/open-mmlab/mmdetection/blob/master/demo/inference_demo.ipynb). #### Asynchronous interface - supported for Python 3.7+ @@ -174,7 +174,7 @@ If you want to specify the working directory in the command, you can add an argu Optional arguments are: -- `--validate` (**strongly recommended**): Perform evaluation at every k (default value is 1, which can be modified like [this](../configs/mask_rcnn_r50_fpn_1x.py#L174)) epochs during the training. +- `--validate` (**strongly recommended**): Perform evaluation at every k (default value is 1, which can be modified like [this](https://github.com/open-mmlab/mmdetection/blob/master/configs/mask_rcnn_r50_fpn_1x.py#L174)) epochs during the training. - `--work_dir ${WORK_DIR}`: Override the working directory specified in the config file. - `--resume_from ${CHECKPOINT_FILE}`: Resume from a previous checkpoint file. @@ -196,7 +196,7 @@ Here is an example of using 16 GPUs to train Mask R-CNN on the dev partition. ./tools/slurm_train.sh dev mask_r50_1x configs/mask_rcnn_r50_fpn_1x.py /nfs/xxxx/mask_rcnn_r50_fpn_1x 16 ``` -You can check [slurm_train.sh](../tools/slurm_train.sh) for full arguments and environment variables. +You can check [slurm_train.sh](https://github.com/open-mmlab/mmdetection/blob/master/tools/slurm_train.sh) for full arguments and environment variables. If you have just multiple machines connected with ethernet, you can refer to pytorch [launch utility](https://pytorch.org/docs/stable/distributed_deprecated.html#launch-utility). @@ -252,12 +252,12 @@ average iter time: 1.1959 s/iter ``` -### Analyse Class-Wise Performance +### Analyse class-wise performance You can analyse the class-wise mAP to have a more comprehensive understanding of the model. ```shell -python coco_eval.py ${RESULT} --ann ${ANNOTATION_PATH} --types bbox --classwise +python coco_eval.py ${RESULT} --ann ${ANNOTATION_PATH} --types bbox --classwise ``` Now we only support class-wise mAP for all the evaluation types, we will support class-wise mAR in the future. @@ -284,7 +284,7 @@ Params: 37.74 M (1) FLOPs are related to the input shape while parameters are not. The default input shape is (1, 3, 1280, 800). (2) Some operators are not counted into FLOPs like GN and custom operators. -You can add support for new operators by modifying [`mmdet/utils/flops_counter.py`](mmdet/utils/flops_counter.py). +You can add support for new operators by modifying [`mmdet/utils/flops_counter.py`](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/utils/flops_counter.py). (3) The FLOPs of two-stage detectors is dependent on the number of proposals. ### Publish a model @@ -375,12 +375,12 @@ There are two ways to work with custom datasets. You can write a new Dataset class inherited from `CustomDataset`, and overwrite two methods `load_annotations(self, ann_file)` and `get_ann_info(self, idx)`, - like [CocoDataset](../mmdet/datasets/coco.py) and [VOCDataset](../mmdet/datasets/voc.py). + like [CocoDataset](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/datasets/coco.py) and [VOCDataset](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/datasets/voc.py). - offline conversion You can convert the annotation format to the expected format above and save it to - a pickle or json file, like [pascal_voc.py](../tools/convert_datasets/pascal_voc.py). + a pickle or json file, like [pascal_voc.py](https://github.com/open-mmlab/mmdetection/blob/master/tools/convert_datasets/pascal_voc.py). Then you can simply use `CustomDataset`. ### Develop new components @@ -410,7 +410,7 @@ class MobileNet(nn.Module): def forward(x): # should return a tuple pass - + def init_weights(self, pretrained=None): pass ``` diff --git a/docs/INSTALL.md b/docs/INSTALL.md index b88380b..18bbe42 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -3,17 +3,17 @@ ### Requirements - Linux (Windows is not officially supported) -- Python 3.5+ (Python 2 is not supported) +- Python 3.5+ - PyTorch 1.1 or higher - CUDA 9.0 or higher - NCCL 2 -- GCC(G++) 4.9 or higher +- GCC 4.9 or higher - [mmcv](https://github.com/open-mmlab/mmcv) We have tested the following versions of OS and softwares: - OS: Ubuntu 16.04/18.04 and CentOS 7.2 -- CUDA: 9.0/9.2/10.0 +- CUDA: 9.0/9.2/10.0/10.1 - NCCL: 2.1.15/2.2.13/2.3.7/2.4.2 - GCC(G++): 4.9/5.3/5.4/7.3 @@ -26,7 +26,7 @@ conda create -n open-mmlab python=3.7 -y conda activate open-mmlab ``` -b. Install PyTorch stable or nightly and torchvision following the [official instructions](https://pytorch.org/), e.g., +b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g., ```shell conda install pytorch torchvision -c pytorch @@ -49,7 +49,7 @@ python setup.py develop # or "pip install -v -e ." Note: 1. The git commit id will be written to the version number with step d, e.g. 0.6.0+2e7045c. The version will also be saved in trained models. -It is recommended that you run step d each time you pull some updates from github. If C/CUDA codes are modified, then this step is compulsory. +It is recommended that you run step d each time you pull some updates from github. If C++/CUDA codes are modified, then this step is compulsory. 2. Following the above instructions, mmdetection is installed on `dev` mode, any local modifications made to the code will take effect without the need to reinstall it (unless you submit some commits and want to update the version number). @@ -58,7 +58,7 @@ you can install it before installing MMCV. ### Another option: Docker Image -We provide a [Dockerfile](../docker/Dockerfile) to build an image. +We provide a [Dockerfile](https://github.com/open-mmlab/mmdetection/blob/master/docker/Dockerfile) to build an image. ```shell # build an image with PyTorch 1.1, CUDA 10.0 and CUDNN 7.5 @@ -91,19 +91,32 @@ mmdetection ``` The cityscapes annotations have to be converted into the coco format using the [cityscapesScripts](https://github.com/mcordts/cityscapesScripts) toolbox. -We plan to provide an easy to use conversion script. For the moment we recommend following the instructions provided in the +We plan to provide an easy to use conversion script. For the moment we recommend following the instructions provided in the [maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark/tree/master/maskrcnn_benchmark/data) toolbox. When using this script all images have to be moved into the same folder. On linux systems this can e.g. be done for the train images with: ```shell cd data/cityscapes/ mv train/*/* train/ ``` -### Scripts +### A from-scratch setup script -[Here](https://gist.github.com/hellock/bf23cd7348c727d69d48682cb6909047) is -a script for setting up mmdetection with conda. +Here is a full script for setting up mmdetection with conda and link the dataset path. -### Multiple versions +```shell +conda create -n open-mmlab python=3.7 -y +conda activate open-mmlab + +conda install -c pytorch pytorch torchvision -y +conda install cython -y +git clone https://github.com/open-mmlab/mmdetection.git +cd mmdetection +pip install -v -e . + +mkdir data +ln -s $COCO_ROOT data +``` + +### Using multiple MMDetection versions If there are more than one mmdetection on your machine, and you want to use them alternatively, the recommended way is to create multiple conda environments and use different environments for different versions. @@ -113,7 +126,8 @@ import os.path as osp import sys sys.path.insert(0, osp.join(osp.dirname(osp.abspath(__file__)), '../')) ``` -or run the following command in the terminal of corresponding folder. + +Or run the following command in the terminal of corresponding folder to temporally use the current one. ```shell export PYTHONPATH=`pwd`:$PYTHONPATH ``` diff --git a/docs/MODEL_ZOO.md b/docs/MODEL_ZOO.md index 1b8f11f..53b65ad 100644 --- a/docs/MODEL_ZOO.md +++ b/docs/MODEL_ZOO.md @@ -203,7 +203,7 @@ More models with different backbones will be added to the model zoo. **Notes:** -- Please refer to [Hybrid Task Cascade](../configs/htc/README.md) for details and more a powerful model (50.7/43.9). +- Please refer to [Hybrid Task Cascade](https://github.com/open-mmlab/mmdetection/blob/master/configs/htc) for details and more a powerful model (50.7/43.9). ### SSD @@ -220,66 +220,66 @@ More models with different backbones will be added to the model zoo. ### Group Normalization (GN) -Please refer to [Group Normalization](../configs/gn/README.md) for details. +Please refer to [Group Normalization](https://github.com/open-mmlab/mmdetection/blob/master/configs/gn) for details. ### Weight Standardization -Please refer to [Weight Standardization](../configs/gn+ws/README.md) for details. +Please refer to [Weight Standardization](https://github.com/open-mmlab/mmdetection/blob/master/configs/gn+ws) for details. ### Deformable Convolution v2 -Please refer to [Deformable Convolutional Networks](../configs/dcn/README.md) for details. +Please refer to [Deformable Convolutional Networks](https://github.com/open-mmlab/mmdetection/blob/master/configs/dcn) for details. ### Libra R-CNN -Please refer to [Libra R-CNN](../configs/libra_rcnn/README.md) for details. +Please refer to [Libra R-CNN](https://github.com/open-mmlab/mmdetection/blob/master/configs/libra_rcnn) for details. ### Guided Anchoring -Please refer to [Guided Anchoring](../configs/guided_anchoring/README.md) for details. +Please refer to [Guided Anchoring](https://github.com/open-mmlab/mmdetection/blob/master/configs/guided_anchoring) for details. ### FCOS -Please refer to [FCOS](../configs/fcos/README.md) for details. +Please refer to [FCOS](https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos) for details. ### FoveaBox -Please refer to [FoveaBox](../configs/foveabox/README.md) for details. +Please refer to [FoveaBox](https://github.com/open-mmlab/mmdetection/blob/master/configs/foveabox) for details. ### RepPoints -Please refer to [RepPoints](../configs/reppoints/README.md) for details. +Please refer to [RepPoints](https://github.com/open-mmlab/mmdetection/blob/master/configs/reppoints) for details. ### FreeAnchor -Please refer to [FreeAnchor](../configs/free_anchor/README.md) for details. +Please refer to [FreeAnchor](https://github.com/open-mmlab/mmdetection/blob/master/configs/free_anchor) for details. ### Grid R-CNN (plus) -Please refer to [Grid R-CNN](../configs/grid_rcnn/README.md) for details. +Please refer to [Grid R-CNN](https://github.com/open-mmlab/mmdetection/blob/master/configs/grid_rcnn) for details. ### GHM -Please refer to [GHM](../configs/ghm/README.md) for details. +Please refer to [GHM](https://github.com/open-mmlab/mmdetection/blob/master/configs/ghm) for details. ### GCNet -Please refer to [GCNet](../configs/gcnet/README.md) for details. +Please refer to [GCNet](https://github.com/open-mmlab/mmdetection/blob/master/configs/gcnet) for details. ### HRNet -Please refer to [HRNet](../configs/hrnet/README.md) for details. +Please refer to [HRNet](https://github.com/open-mmlab/mmdetection/blob/master/configs/hrnet) for details. ### Mask Scoring R-CNN -Please refer to [Mask Scoring R-CNN](../configs/ms_rcnn/README.md) for details. +Please refer to [Mask Scoring R-CNN](https://github.com/open-mmlab/mmdetection/blob/master/configs/ms_rcnn) for details. ### Train from Scratch -Please refer to [Rethinking ImageNet Pre-training](../configs/scratch/README.md) for details. +Please refer to [Rethinking ImageNet Pre-training](https://github.com/open-mmlab/mmdetection/blob/master/configs/scratch) for details. ### Other datasets -We also benchmark some methods on [PASCAL VOC](../configs/pascal_voc/README.md), [Cityscapes](../configs/cityscapes/README.md) and [WIDER FACE](../configs/wider_face/README.md). +We also benchmark some methods on [PASCAL VOC](https://github.com/open-mmlab/mmdetection/blob/master/configs/pascal_voc), [Cityscapes](https://github.com/open-mmlab/mmdetection/blob/master/configs/cityscapes) and [WIDER FACE](https://github.com/open-mmlab/mmdetection/blob/master/configs/wider_face). ## Comparison with Detectron and maskrcnn-benchmark diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -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) diff --git a/docs/TECHNICAL_DETAILS.md b/docs/TECHNICAL_DETAILS.md index e58d11a..91b0cfb 100644 --- a/docs/TECHNICAL_DETAILS.md +++ b/docs/TECHNICAL_DETAILS.md @@ -1,21 +1,135 @@ -## Overview +# Technical Details In this section, we will introduce the main units of training a detector: -data loading, model and iteration pipeline. +data pipeline, model and iteration pipeline. -## Data loading +## Data pipeline Following typical conventions, we use `Dataset` and `DataLoader` for data loading with multiple workers. `Dataset` returns a dict of data items corresponding the arguments of models' forward method. Since the data in object detection may not be the same size (image size, gt bbox size, etc.), -we introduce a new `DataContainer` type in `mmcv` to help collect and distribute +we introduce a new `DataContainer` type in MMCV to help collect and distribute data of different size. See [here](https://github.com/open-mmlab/mmcv/blob/master/mmcv/parallel/data_container.py) for more details. +The data preparation pipeline and the dataset is decomposed. Usually a dataset +defines how to process the annotations and a data pipeline defines all the steps to prepare a data dict. +A pipeline consists of a sequence of operations. Each operation takes a dict as input and also output a dict for the next transform. + +We present a classical pipeline in the following figure. The blue blocks are pipeline operations. With the pipeline going on, each operator can add new keys (marked as green) to the result dict or update the existing keys (marked as orange). + + +The operations are categorized into data loading, pre-processing, formatting and test-time augmentation. + +Here is an pipeline example for Faster R-CNN. +```python +img_norm_cfg = dict( + mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) +train_pipeline = [ + dict(type='LoadImageFromFile'), + dict(type='LoadAnnotations', with_bbox=True), + dict(type='Resize', img_scale=(1333, 800), keep_ratio=True), + dict(type='RandomFlip', flip_ratio=0.5), + dict(type='Normalize', **img_norm_cfg), + dict(type='Pad', size_divisor=32), + dict(type='DefaultFormatBundle'), + dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']), +] +test_pipeline = [ + dict(type='LoadImageFromFile'), + dict( + type='MultiScaleFlipAug', + img_scale=(1333, 800), + flip=False, + transforms=[ + dict(type='Resize', keep_ratio=True), + dict(type='RandomFlip'), + dict(type='Normalize', **img_norm_cfg), + dict(type='Pad', size_divisor=32), + dict(type='ImageToTensor', keys=['img']), + dict(type='Collect', keys=['img']), + ]) +] +``` + +For each operation, we list the related dict fields that are added/updated/removed. + +### Data loading + +`LoadImageFromFile` +- add: img, img_shape, ori_shape + +`LoadAnnotations` +- add: gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg, bbox_fields, mask_fields + +`LoadProposals` +- add: proposals + +### Pre-processing + +`Resize` +- add: scale, scale_idx, pad_shape, scale_factor, keep_ratio +- update: img, img_shape, *bbox_fields, *mask_fields, *seg_fields + +`RandomFlip` +- add: flip +- update: img, *bbox_fields, *mask_fields, *seg_fields + +`Pad` +- add: pad_fixed_size, pad_size_divisor +- update: img, pad_shape, *mask_fields, *seg_fields + +`RandomCrop` +- update: img, pad_shape, gt_bboxes, gt_labels, gt_masks, *bbox_fields + +`Normalize` +- add: img_norm_cfg +- update: img + +`SegRescale` +- update: gt_semantic_seg + +`PhotoMetricDistortion` +- update: img + +`Expand` +- update: img, gt_bboxes + +`MinIoURandomCrop` +- update: img, gt_bboxes, gt_labels + +`Corrupt` +- update: img + +### Formatting + +`ToTensor` +- update: specified by `keys`. + +`ImageToTensor` +- update: specified by `keys`. + +`Transpose` +- update: specified by `keys`. + +`ToDataContainer` +- update: specified by `fields`. + +`DefaultFormatBundle` +- update: img, proposals, gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg + +`Collect` +- add: img_meta (the keys of img_meta is specified by `meta_keys`) +- remove: all other keys except for those specified by `keys` + +### Test time augmentation + +`MultiScaleFlipAug` + ## Model -In mmdetection, model components are basically categorized as 4 types. +In MMDetection, model components are basically categorized as 4 types. - backbone: usually a FCN network to extract feature maps, e.g., ResNet. - neck: the part between backbones and heads, e.g., FPN, ASPP. @@ -55,6 +169,12 @@ FPN structure in [Path Aggregation Network for Instance Segmentation](https://ar pass ``` +2. Import the module in `mmdet/models/necks/__init__.py`. + + ```python + from .pafpn import PAFPN + ``` + 2. modify the config file from ```python diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..63c5763 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,67 @@ +# 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 sys +# sys.path.insert(0, os.path.abspath('.')) + +# -- Project information ----------------------------------------------------- + +project = 'MMDetection' +copyright = '2018-2019, OpenMMLab' +author = 'OpenMMLab' + +# The full version, including alpha/beta/rc tags +release = '1.0rc1' + +# -- 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 = ['torch', 'torchvision', 'mmcv'] + +# 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', +} + +# 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'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..6e56b14 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,19 @@ +Welcome to MMDetection's documentation! +======================================= + +.. toctree:: + :maxdepth: 2 + + INSTALL.md + GETTING_STARTED.md + MODEL_ZOO.md + TECHNICAL_DETAILS.md + CHANGELOG.md + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..2119f51 --- /dev/null +++ b/docs/make.bat @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..89fbf86 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +recommonmark +sphinx +sphinx_markdown_tables +sphinx_rtd_theme -- GitLab