OpenMMLab Computer Vision Foundation
 
 
 
 
Go to file
Jiamin fad12cd366
Add jenkinsfile (#415)
* chore: add jenkins file

* chore: remove cuda_arch

* chore: replace Float.parsefloat with string check

* chore: add pip mirror

* chore: fix add MMCV_WITH_OPS env var

* chore: fix undefined symbol _Z16THPVariable_WrapN2at6TensorE

* chore: add comment

* chore: fix multi docker running under same dir error

* chore: rm dir after build

* chore: fix rm

* chore: also rm tmp dir

* chore: use sensetime docker

* feat: use torch-pre-installed docker

* fix: fix index error
2020-07-23 17:06:34 +08:00
.github/workflows Support FP16 (#428) 2020-07-17 11:14:07 +08:00
docs fix docs (#440) 2020-07-21 14:48:16 +08:00
examples Fix docstring formats (#383) 2020-07-04 00:55:25 +08:00
mmcv Add runner.meta to checkpoint in save_checkpoint() (#438) 2020-07-20 11:40:04 +08:00
tests Add runner.meta to checkpoint in save_checkpoint() (#438) 2020-07-20 11:40:04 +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 Add jenkinsfile (#415) 2020-07-23 17:06:34 +08:00
LICENSE Add copyright header (#171) 2020-01-10 13:34:42 +08:00
MANIFEST.in include cuda and cpp files (#379) 2020-07-02 19:18:22 +08:00
README.md fix docs (#440) 2020-07-21 14:48:16 +08:00
requirements.txt include cuda and cpp files (#379) 2020-07-02 19:18:22 +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.5torch 1.4torch 1.3
10.2
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.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
10.0
9.2
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.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=lang CXX=clang++ CFLAGS='-stdlib=libc++'

e.g.,

CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' 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.