Unverified Commit 18d63720 authored by Wenwei Zhang's avatar Wenwei Zhang Committed by GitHub
Browse files

Rewrite readme.rst by markdown (#391)

* Rewrite readme.rst by markdown

* Update setup.py

* Update mmcv links

* clean code

* Add logo

* Resolve comments

* clean unnecessary code change
parent 039e06e4
<div align="center">
<img src="./docs/mmcv-logo.png" width="300"/>
</div>
[![PyPI](https://img.shields.io/pypi/v/mmcv)](https://pypi.org/project/mmcv) [![badge](https://github.com/open-mmlab/mmcv/workflows/build/badge.svg)](https://github.com/open-mmlab/mmcv/actions) [![codecov](https://codecov.io/gh/open-mmlab/mmcv/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmcv) [![license](https://img.shields.io/github/license/open-mmlab/mmcv.svg)](https://github.com/open-mmlab/mmcv/blob/master/LICENSE)
## Introduction
MMCV is a foundational python library for computer vision research and supports many
research projects in MMLAB, such as [MMDetection](https://github.com/open-mmlab/mmdetection) and [MMAction](https://github.com/open-mmlab/mmaction).
It provides the following functionalities.
- Universal IO APIs
- Image/Video processing
- Image and annotation visualization
- Useful utilities (progress bar, timer, ...)
- PyTorch runner with hooking mechanism
- Various CNN architectures
- High-quality implementation of common CUDA ops
See the [documentation](http://mmcv.readthedocs.io/en/latest) for more features and usage.
Note: MMCV requires Python 3.6+.
## Installation
Try and start with
```bash
pip install mmcv
```
or install from source
```bash
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
pip install -e .
```
If you are on macOS, replace the last command with
```bash
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' pip install -e .
```
Note that the building process may take up to 10 mins. We also provide pre-built mmcv with corresponding Pytorch and CUDA versions to simplify the building.
<table class="docutils"><tbody><tr><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.5</th><th valign="bottom" align="left" width="100">torch 1.4</th><th valign="bottom" align="left" width="100">torch 1.3</th></tr>
<tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.5.0+cu102 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr>
<tr><td align="left">10.1</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv==1.0rc0+torch1.5.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.4.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.3.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td></tr>
<tr><td align="left">10.0</td><td align="left"> </td><td align="left"> </td> <td align="left"> </td> </tr>
<tr><td align="left">9.2</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv==1.0rc0+torch1.5.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.4.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.3.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td></tr>
<tr><td align="left">cpu</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv==1.0rc0+torch1.5.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.4.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv==1.0rc0+torch1.3.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> </tr>
</tbody></table>
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`.
MMCV
====
.. image:: https://img.shields.io/pypi/v/mmcv
:target: https://pypi.org/project/mmcv
.. image:: https://github.com/open-mmlab/mmcv/workflows/build/badge.svg
:target: https://github.com/open-mmlab/mmcv/actions
.. image:: https://codecov.io/gh/open-mmlab/mmcv/branch/master/graph/badge.svg
:target: https://codecov.io/gh/open-mmlab/mmcv
.. image:: https://img.shields.io/github/license/open-mmlab/mmcv.svg
:target: https://github.com/open-mmlab/mmcv/blob/master/LICENSE
Introduction
------------
MMCV is a foundational python library for computer vision research and supports many
research projects in MMLAB, such as `MMDetection <https://github.com/open-mmlab/mmdetection>`_
and `MMAction <https://github.com/open-mmlab/mmaction>`_.
It provides the following functionalities.
- Universal IO APIs
- Image/Video processing
- Image and annotation visualization
- Useful utilities (progress bar, timer, ...)
- PyTorch runner with hooking mechanism
- Various CNN architectures
- High-quality implementation of common CUDA ops
See the `documentation <http://mmcv.readthedocs.io/en/latest>`_ for more features and usage.
Note: MMCV requires Python 3.6+.
Installation
------------
Try and start with
.. code::
pip install mmcv
or install from source
.. code::
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
pip install -e .
If you are on macOS, replace the last command with
.. code::
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' pip install -e .
Note: If you would like to use :code:`opencv-python-headless` instead of :code:`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 :code:`opencv-python`.
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
import os import os
import sys import sys
from m2r import MdInclude
from recommonmark.transform import AutoStructify
sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('..'))
version_file = '../mmcv/version.py' version_file = '../mmcv/version.py'
...@@ -46,12 +49,14 @@ extensions = [ ...@@ -46,12 +49,14 @@ extensions = [
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'recommonmark', 'recommonmark',
'sphinx.ext.autosectionlabel',
] ]
autodoc_mock_imports = [ autodoc_mock_imports = [
'cv2', 'mmcv._ext', 'mmcv._flow_warp_ext', 'mmcv.utils.ext_loader', 'cv2', 'mmcv._ext', 'mmcv._flow_warp_ext', 'mmcv.utils.ext_loader',
'torchvision' 'torchvision'
] ]
autosectionlabel_prefix_document = True
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
...@@ -176,3 +181,16 @@ epub_title = project ...@@ -176,3 +181,16 @@ epub_title = project
epub_exclude_files = ['search.html'] epub_exclude_files = ['search.html']
# -- Extension configuration ------------------------------------------------- # -- Extension configuration -------------------------------------------------
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)
.. include:: ../README.rst
.. mdinclude:: readme.md
Contents Contents
======== ========
......
../README.md
\ No newline at end of file
...@@ -14,6 +14,6 @@ line_length = 79 ...@@ -14,6 +14,6 @@ line_length = 79
multi_line_output = 0 multi_line_output = 0
known_standard_library = pkg_resources,setuptools known_standard_library = pkg_resources,setuptools
known_first_party = mmcv known_first_party = mmcv
known_third_party = Cython,addict,cv2,numpy,pytest,resnet_cifar,torch,torchvision,yaml,yapf known_third_party = Cython,addict,cv2,m2r,numpy,pytest,recommonmark,resnet_cifar,torch,torchvision,yaml,yapf
no_lines_before = STDLIB,LOCALFOLDER no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY default_section = THIRDPARTY
...@@ -37,7 +37,7 @@ def choose_requirement(primary, secondary): ...@@ -37,7 +37,7 @@ def choose_requirement(primary, secondary):
def readme(): def readme():
with open('README.rst', encoding='utf-8') as f: with open('README.md', encoding='utf-8') as f:
content = f.read() content = f.read()
return content return content
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment