GitHub - open-mmlab/mmcv at 2.x (original) (raw)

docs platform PyPI - Python Version pytorch cuda PyPI badge codecov license

English | 简体中文

Introduction

MMCV is a foundational library for computer vision research and it provides the following functionalities:

It supports the following systems:

See the documentation for more features and usage.

Note: MMCV requires Python 3.7+.

Installation

There are two versions of MMCV:

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. Installing the full version is highly recommended if CUDA is available.

Install mmcv

Before installing mmcv, make sure that PyTorch has been successfully installed following the PyTorch official installation guide. For apple silicon users, please use PyTorch 1.13+.

The command to install mmcv:

pip install -U openmim mim install "mmcv>=2.0.0rc1"

If you need to specify the version of mmcv, you can use the following command:

mim install mmcv==2.0.0rc3

If you find that the above installation command does not use a pre-built package ending with .whl but a source package ending with .tar.gz, you may not have a pre-build package corresponding to the PyTorch or CUDA or mmcv version, in which case you can build mmcv from source.

Installation log using pre-built packages

Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
Collecting mmcv
Downloading https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/mmcv-2.0.0rc3-cp38-cp38-manylinux1_x86_64.whl

Installation log using source packages

Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
Collecting mmcv==2.0.0rc3
Downloading mmcv-2.0.0rc3.tar.gz

For more installation methods, please refer to the Installation documentation.

Install mmcv-lite

If you need to use PyTorch-related modules, make sure PyTorch has been successfully installed in your environment by referring to the PyTorch official installation guide.

pip install -U openmim mim install "mmcv-lite>=2.0.0rc1"

FAQ

If you face some installation issues, CUDA related issues or RuntimeErrors, you may first refer to this Frequently Asked Questions.

If you face installation problems or runtime issues, you may first refer to this Frequently Asked Questions to see if there is a solution. If the problem is still not solved, feel free to open an issue.

Citation

If you find this project useful in your research, please consider cite:

@misc{mmcv, title={{MMCV: OpenMMLab} Computer Vision Foundation}, author={MMCV Contributors}, howpublished = {\url{https://github.com/open-mmlab/mmcv}}, year={2018} }

Contributing

We appreciate all contributions to improve MMCV. Please refer to CONTRIBUTING.md for the contributing guideline.

License

MMCV is released under the Apache 2.0 license, while some specific operations in this library are with other licenses. Please refer to LICENSES.md for the careful check, if you are using our code for commercial matters.

Projects in OpenMMLab