2021-02-21 21:24:53 +08:00
< div align = "center" >
2022-01-13 16:40:12 +08:00
< img src = "https://raw.githubusercontent.com/open-mmlab/mmcv/master/docs/en/mmcv-logo.png" width = "300" / >
< div > < / div >
< div align = "center" >
< b > < font size = "5" > OpenMMLab 官网< / font > < / b >
< sup >
< a href = "https://openmmlab.com" >
< i > < font size = "4" > HOT< / font > < / i >
< / a >
< / sup >
< b > < font size = "5" > OpenMMLab 开放平台< / font > < / b >
< sup >
< a href = "https://platform.openmmlab.com" >
< i > < font size = "4" > TRY IT OUT< / font > < / i >
< / a >
< / sup >
< / div >
< div > < / div >
2021-02-21 21:24:53 +08:00
< / div >
2022-01-10 16:26:37 +08:00
[](https://mmcv.readthedocs.io/zh_CN/latest/)
2022-10-17 17:10:03 +08:00
[](https://mmcv.readthedocs.io/zh_CN/latest/get_started/installation.html)
2022-01-10 16:26:37 +08:00
[](https://pypi.org/project/mmcv/)
[](https://pypi.org/project/mmcv)
[](https://github.com/open-mmlab/mmcv/actions)
[](https://codecov.io/gh/open-mmlab/mmcv)
[](https://github.com/open-mmlab/mmcv/blob/master/LICENSE)
2021-02-21 21:24:53 +08:00
[English ](README.md ) | 简体中文
## 简介
2022-10-17 17:10:03 +08:00
MMCV 是一个面向计算机视觉的基础库,它提供了以下功能:
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
- [通用的 IO 接口 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/io.html )
- [图像和视频处理 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/data_process.html )
- [图像和标注结果可视化 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/visualization.html )
- [常用小工具(进度条,计时器等) ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/utils.html )
- [基于 PyTorch 的通用训练框架 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/runner.html )
- [多种 CNN 网络结构 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/cnn.html )
- [高质量实现的 CPU 和 CUDA 算子 ](https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/ops.html )
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
MMCV 支持多种平台,包括:
2022-03-23 23:41:51 +08:00
- Linux
- Windows
- macOS
2022-10-17 17:10:03 +08:00
如想了解更多特性和用法,请参考[文档](http://mmcv.readthedocs.io/zh_CN/latest)。
2021-02-21 21:24:53 +08:00
提示: MMCV 需要 Python 3.6 以上版本。
## 安装
MMCV 有两个版本:
2022-10-17 17:10:03 +08:00
- **mmcv-full**: 完整版,包含所有的特性以及丰富的开箱即用的 CPU 和 CUDA 算子。
- **mmcv**: 精简版,不包含 CPU 和 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用算子的话,精简版可以作为一个考虑选项。
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
**注意**: 请不要在同一个环境中安装两个版本,否则可能会遇到类似 `ModuleNotFound` 的错误。在安装一个版本之前,需要先卸载另一个。`如果 CUDA 可用,强烈推荐安装 mmcv-full`。
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
### 安装 mmcv-full
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
在安装 mmcv-full 之前,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档 ](https://github.com/pytorch/pytorch#installation )。
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
在 Linux 和 Windows 平台安装 mmcv-full 的命令如下(如果你的系统是 macOS, 请参考[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html#macos-mmcv-full))
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
```bash
pip install -U openmim
mim install mmcv-full
2021-02-21 21:24:53 +08:00
```
2022-10-17 17:10:03 +08:00
如果需要指定 mmcv-full 的版本,可以使用以下命令
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
```bash
mim install mmcv-full==1.5.0
2021-02-21 21:24:53 +08:00
```
2022-10-17 17:10:03 +08:00
如果发现上述的安装命令没有使用预编译包(以 `.whl` 结尾)而是使用源码包(以 `.tar.gz` 结尾)安装,则有可能是我们没有提供和当前环境的 PyTorch 版本、CUDA 版本相匹配的 mmcv-full 预编译包,此时,你可以[源码安装 mmcv-full](https://mmcv.readthedocs.io/zh_CN/latest/get_started/build.html)。
2021-10-13 20:25:49 +08:00
2022-10-17 17:10:03 +08:00
< details >
< summary > 使用预编译包的安装日志< / summary >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html< br / >
Collecting mmcv-full< br / >
< b > Downloading https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/mmcv_full-1.6.1-cp38-cp38-manylinux1_x86_64.whl< / b >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
< / details >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
< details >
< summary > 使用源码包的安装日志< / summary >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
Looking in links: https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html< br / >
Collecting mmcv-full==1.6.0< br / >
< b > Downloading mmcv-full-1.6.0.tar.gz< / b >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
< / details >
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
更多安装方式请参考[安装文档](https://mmcv.readthedocs.io/zh_CN/latest/get_started/installation.html)。
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
### 安装 mmcv
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
如果你需要使用和 PyTorch 相关的模块,请确保 PyTorch 已经成功安装在环境中,可以参考 [PyTorch 官方安装文档 ](https://github.com/pytorch/pytorch#installation )。
2021-04-25 19:25:14 +08:00
2022-10-17 17:10:03 +08:00
```bash
pip install -U openmim
mim install mmcv
2021-04-25 19:25:14 +08:00
```
2022-10-17 17:10:03 +08:00
## 支持的开源项目
2021-02-21 21:24:53 +08:00
2022-10-17 17:10:03 +08:00
- [MIM ](https://github.com/open-mmlab/mim ): MIM 是 OpenMMlab 项目、算法、模型的统一入口
- [MMClassification ](https://github.com/open-mmlab/mmclassification ): OpenMMLab 图像分类工具箱
- [MMDetection ](https://github.com/open-mmlab/mmdetection ): OpenMMLab 目标检测工具箱
- [MMDetection3D ](https://github.com/open-mmlab/mmdetection3d ): OpenMMLab 新一代通用 3D 目标检测平台
- [MMRotate ](https://github.com/open-mmlab/mmrotate ): OpenMMLab 旋转框检测工具箱与测试基准
- [MMSegmentation ](https://github.com/open-mmlab/mmsegmentation ): OpenMMLab 语义分割工具箱
- [MMOCR ](https://github.com/open-mmlab/mmocr ): OpenMMLab 全流程文字检测识别理解工具箱
- [MMPose ](https://github.com/open-mmlab/mmpose ): OpenMMLab 姿态估计工具箱
- [MMHuman3D ](https://github.com/open-mmlab/mmhuman3d ): OpenMMLab 人体参数化模型工具箱与测试基准
- [MMSelfSup ](https://github.com/open-mmlab/mmselfsup ): OpenMMLab 自监督学习工具箱与测试基准
- [MMRazor ](https://github.com/open-mmlab/mmrazor ): OpenMMLab 模型压缩工具箱与测试基准
- [MMFewShot ](https://github.com/open-mmlab/mmfewshot ): OpenMMLab 少样本学习工具箱与测试基准
- [MMAction2 ](https://github.com/open-mmlab/mmaction2 ): OpenMMLab 新一代视频理解工具箱
- [MMTracking ](https://github.com/open-mmlab/mmtracking ): OpenMMLab 一体化视频目标感知平台
- [MMFlow ](https://github.com/open-mmlab/mmflow ): OpenMMLab 光流估计工具箱与测试基准
- [MMEditing ](https://github.com/open-mmlab/mmediting ): OpenMMLab 图像视频编辑工具箱
- [MMGeneration ](https://github.com/open-mmlab/mmgeneration ): OpenMMLab 图片视频生成模型工具箱
- [MMDeploy ](https://github.com/open-mmlab/mmdeploy ): OpenMMLab 模型部署框架
2021-02-21 21:24:53 +08:00
## FAQ
2022-10-17 17:10:03 +08:00
如果你遇到了安装问题或者运行时问题,请查看[问题解决页面](https://mmcv.readthedocs.io/zh_CN/latest/faq.html)是否已有解决方案。如果问题仍然没有解决,欢迎提 [issue ](https://github.com/open-mmlab/mmcv/issues )。
2021-02-21 21:24:53 +08:00
## 贡献指南
我们感谢所有的贡献者为改进和提升 MMCV 所作出的努力。请参考[贡献指南](CONTRIBUTING.md)来了解参与项目贡献的相关指引。
2021-04-16 21:22:51 +08:00
2021-05-13 21:55:44 +08:00
## 许可证
2022-10-17 17:10:03 +08:00
`MMCV` 目前以 Apache 2.0 的许可证发布,但是其中有一部分功能并不是使用的 Apache2.0 许可证,我们在[许可证](LICENSES.md)中详细地列出了这些功能以及他们对应的许可证,如果您正在从事盈利性活动,请谨慎参考此文档。
2022-05-16 20:47:56 +08:00
2021-04-16 21:22:51 +08:00
## 欢迎加入 OpenMMLab 社区
2022-10-17 17:10:03 +08:00
扫描下方的二维码可关注 OpenMMLab 团队的[知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 OpenMMLab 团队的[官方交流 QQ 群](https://jq.qq.com/?_wv=1027& k=3ijNTqfg), 或添加微信小助手”OpenMMLabwx“加入官方交流微信群。
2021-04-16 21:22:51 +08:00
< div align = "center" >
2022-01-19 22:35:36 +08:00
< img src = "docs/en/_static/zhihu_qrcode.jpg" height = "400" / > < img src = "docs/en/_static/qq_group_qrcode.jpg" height = "400" / > < img src = "docs/en/_static/wechat_qrcode.jpg" height = "400" / >
2021-04-16 21:22:51 +08:00
< / div >
我们会在 OpenMMLab 社区为大家
- 📢 分享 AI 框架的前沿核心技术
- 💻 解读 PyTorch 常用模块源码
- 📰 发布 OpenMMLab 的相关新闻
- 🚀 介绍 OpenMMLab 开发的前沿算法
- 🏃 获取更高效的问题答疑和意见反馈
- 🔥 提供与各行各业开发者充分交流的平台
干货满满 📘,等你来撩 💗, OpenMMLab 社区期待您的加入 👬