OpenMMLab Computer Vision Foundation
 
 
 
 
Go to file
Wenwei Zhang ed2887bb72
Support to specify LR of DCN's conv_offset (#344)
* Support to specify LR of DCN's conv_offset

* Resolve comments & add unit test

* Resolve formats

* Fix CI for DCN

* Mock DCN when cpu only

* Use mock for cpu testing

* Fix docstring and support ModulatedDCN

* set offset_lr_mult as dcn's arguments, link CU-49u01p

* fix lr bug

* fall back to set LR in constructor

* resolve comments
2020-09-25 20:51:58 +08:00
.github/workflows [feature] Use cu92 & ubuntu1604 for torch 1.3.1 (#524) 2020-09-01 16:15:03 +08:00
docs add op trouble shooting (#479) 2020-08-13 22:04:58 +08:00
examples Fix docstring formats (#383) 2020-07-04 00:55:25 +08:00
mmcv Support to specify LR of DCN's conv_offset (#344) 2020-09-25 20:51:58 +08:00
tests Support to specify LR of DCN's conv_offset (#344) 2020-09-25 20:51:58 +08:00
.dockerignore fix dependencies (#146) 2019-11-21 23:34:26 +08:00
.gitignore Add docs for CNN modules (#266) 2020-05-05 12:02:33 +08:00
.pre-commit-config.yaml update pre-commit hook config (#384) 2020-07-04 02:53:51 +08:00
.readthedocs.yml add missing requirements for the doc building (#269) 2020-05-05 14:22:23 +08:00
CONTRIBUTING.md Update pre-commit hook config (#200) 2020-03-01 15:51:40 +08:00
Dockerfile fix dependencies (#146) 2019-11-21 23:34:26 +08:00
Jenkinsfile Update jenkinsfile (#444) 2020-07-24 19:01:35 +08:00
LICENSE Add copyright header (#171) 2020-01-10 13:34:42 +08:00
MANIFEST.in Support load with mmcls:// (#511) 2020-09-02 19:27:47 +08:00
README.md [fix] Fix compilation bug in windows and add instruction for windows (#540) 2020-09-04 15:08:12 +08:00
requirements.txt Replace `re` with `regex` (#457) 2020-08-03 11:45:50 +08:00
setup.cfg Rewrite readme.rst by markdown (#391) 2020-07-08 01:20:27 +08:00
setup.py fix docs (#440) 2020-07-21 14:48:16 +08:00

README.md

PyPI badge codecov license

Introduction

MMCV is a foundational python library for computer vision research and supports many research projects as below:

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 for more features and usage.

Note: MMCV requires Python 3.6+.

Installation

There are two versions of MMCV:

  • mmcv: lite, without CUDA ops but all other features, similar to mmcv<1.0.0. It is useful when you do not need those CUDA ops.
  • mmcv-full: comprehensive, with full features and various CUDA ops out of box. It takes longer time to build.

Note: Do not install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound. You need to uninstall one before installing the other.

Install with pip

a. Install the lite version.

pip install mmcv

b. Install the full version.

Before installing mmcv-full, make sure that PyTorch has been successfully installed following the official guide.

We provide pre-built mmcv packages (recommended) with different PyTorch and CUDA versions to simplify the building.

CUDA torch 1.6torch 1.5torch 1.4torch 1.3
10.2
install
pip install mmcv-full==latest+torch1.6.0+cu102 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.5.0+cu102 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
10.1
install
 pip install mmcv-full==latest+torch1.6.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
 pip install mmcv-full==latest+torch1.5.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.4.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.3.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
9.2
install
 pip install mmcv-full==latest+torch1.6.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
 pip install mmcv-full==latest+torch1.5.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.4.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.3.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
cpu
install
 pip install mmcv-full==latest+torch1.6.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
 pip install mmcv-full==latest+torch1.5.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.4.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
install
pip install mmcv-full==latest+torch1.3.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html

Another way is to compile locally by running

pip install mmcv-full

Note that the local compiling may take up to 10 mins.

Install from source

After cloning the repo with

git clone https://github.com/open-mmlab/mmcv.git
cd mmcv

You can either

  • install the lite version

    pip install -e .
    
  • install the full version

    MMCV_WITH_OPS=1 pip install -e .
    

If you are on macOS, add the following environment variables before the installing command.

CC=clang CXX=clang++ CFLAGS='-stdlib=libc++'

e.g.,

CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .

If you are on Windows10, set the following environment variable before the installing command.

set MMCV_WITH_OPS=1

e.g.,

set MMCV_WITH_OPS=1
pip install -e .

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.

TroubleShooting

If you meet issues when running or compiling mmcv, we list some common issues in TROUBLESHOOTING.md.