Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Update install guide and README #624

Merged
merged 6 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Please refer to [changelog.md](docs/en/changelog.md) for more details and other

## Benchmark and model zoo

Results and models are available in the [model zoo](docs/en/model_zoo.md).
Results and models are available in the [model zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html).

<details open>
<summary>Supported backbones</summary>
Expand Down Expand Up @@ -85,21 +85,23 @@ Results and models are available in the [model zoo](docs/en/model_zoo.md).

## Installation

Please refer to [install.md](docs/en/install.md) for installation and dataset preparation.
Please refer to [install.md](https://mmclassification.readthedocs.io/en/latest/install.html) for installation and dataset preparation.

## Getting Started
Please see [getting_started.md](docs/en/getting_started.md) for the basic usage of MMClassification. There are also tutorials:
Please see [Getting Started](https://mmclassification.readthedocs.io/en/latest/getting_started.html) for the basic usage of MMClassification. There are also tutorials:

- [learn about configs](docs/en/tutorials/config.md)
- [finetuning models](docs/en/tutorials/finetune.md)
- [adding new dataset](docs/en/tutorials/new_dataset.md)
- [designing data pipeline](docs/en/tutorials/data_pipeline.md)
- [adding new modules](docs/en/tutorials/new_modules.md)
- [customizing schedule](docs/en/tutorials/schedule.md)
- [customizing runtime settings](docs/en/tutorials/runtime.md)
- [Learn about Configs](https://mmclassification.readthedocs.io/en/latest/tutorials/config.html)
- [Fine-tune Models](https://mmclassification.readthedocs.io/en/latest/tutorials/finetune.html)
- [Add New Dataset](https://mmclassification.readthedocs.io/en/latest/tutorials/new_dataset.html)
- [Customizie Data Pipeline](https://mmclassification.readthedocs.io/en/latest/tutorials/data_pipeline.html)
- [Add New Modules](https://mmclassification.readthedocs.io/en/latest/tutorials/new_modules.html)
- [Customizie Schedule](https://mmclassification.readthedocs.io/en/latest/tutorials/schedule.html)
- [Customizie Runtime Settings](https://mmclassification.readthedocs.io/en/latest/tutorials/runtime.html)

Colab tutorials are also provided. To learn about MMClassification Python API, you may preview the notebook [here](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) or directly [run](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) on Colab.
To learn about MMClassification shell tools, you may preview the notebook [here](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) or directly [run](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) on Colab.
Colab tutorials are also provided:

- Learn about MMClassification **Python API**: [Preview the notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) or directly [run on Colab](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb).
- Learn about MMClassification **CLI tools**: [Preview the notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) or directly [run on Colab](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb).

## Citation

Expand All @@ -117,7 +119,7 @@ If you find this project useful in your research, please consider cite:
## Contributing

We appreciate all contributions to improve MMClassification.
Please refer to [CONTRUBUTING.md](docs/en/community/CONTRIBUTING.md) for the contributing guideline.
Please refer to [CONTRUBUTING.md](https://mmclassification.readthedocs.io/en/latest/community/CONTRIBUTING.html) for the contributing guideline.

## Acknowledgement

Expand All @@ -141,3 +143,6 @@ We wish that the toolbox and benchmark could serve the growing research communit
- [MMFlow](https://github.com/open-mmlab/mmflow) OpenMMLab optical flow toolbox and benchmark.
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab FewShot Learning Toolbox and Benchmark.
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D Human Parametric Model Toolbox and Benchmark.
- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab self-supervised learning toolbox and benchmark.
- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab Model Compression Toolbox and Benchmark.
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab Model Deployment Framework.
mzr1996 marked this conversation as resolved.
Show resolved Hide resolved
30 changes: 18 additions & 12 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MMClassification 是一款基于 PyTorch 的开源图像分类工具箱,是 [O

## 基准测试及模型库

相关结果和模型可在 [model zoo](docs/en/model_zoo.md) 中获得
相关结果和模型可在 [model zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html) 中获得

<details open>
<summary>支持的主干网络</summary>
Expand Down Expand Up @@ -84,25 +84,28 @@ MMClassification 是一款基于 PyTorch 的开源图像分类工具箱,是 [O

## 安装

请参考 [安装指南](docs/zh_CN/install.md) 进行安装
请参考 [安装指南](https://mmclassification.readthedocs.io/zh_CN/latest/install.html) 进行安装

## 基础教程

请参考 [基础教程](docs/zh_CN/getting_started.md) 来了解 MMClassification 的基本使用。MMClassification 也提供了其他更详细的教程:
请参考 [基础教程](https://mmclassification.readthedocs.io/zh_CN/latest/getting_started.html) 来了解 MMClassification 的基本使用。MMClassification 也提供了其他更详细的教程:

- [如何编写配置文件](docs/zh_CN/tutorials/config.md)
- [如何微调模型](docs/zh_CN/tutorials/finetune.md)
- [如何增加新数据集](docs/zh_CN/tutorials/new_dataset.md)
- [如何设计数据处理流程](/docs/zh_CN/tutorials/data_pipeline.md)
- [如何增加新模块](docs/zh_CN/tutorials/new_modules.md)
- [如何自定义优化策略](docs/zh_CN/tutorials/schedule.md)
- [如何自定义运行参数](docs/zh_CN/tutorials/runtime.md)
- [如何编写配置文件](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/config.html)
- [如何微调模型](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/finetune.html)
- [如何增加新数据集](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/new_dataset.html)
- [如何设计数据处理流程](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/data_pipeline.html)
- [如何增加新模块](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/new_modules.html)
- [如何自定义优化策略](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/schedule.html)
- [如何自定义运行参数](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/runtime.html)

MMClassification 也提供了相应的中文 Colab 教程。了解 MMClassification Python API,可以查看 [这里](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb) 或者直接在 Colab 上 [运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb)。了解 MMClassification 命令行工具,可以查看 [这里](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb) 或者直接在 Colab 上 [运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb)。
我们也提供了相应的中文 Colab 教程:

- 了解 MMClassification **Python API**:[预览 Notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb) 或者直接[在 Colab 上运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb)。
- 了解 MMClassification **命令行工具**:[预览 Notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb) 或者直接[在 Colab 上运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb)。

## 参与贡献

我们非常欢迎任何有助于提升 MMClassification 的贡献,请参考 [贡献指南](docs/zh_CN/community/CONTRIBUTING.md) 来了解如何参与贡献。
我们非常欢迎任何有助于提升 MMClassification 的贡献,请参考 [贡献指南](https://mmclassification.readthedocs.io/zh_CN/latest/community/CONTRIBUTING.html) 来了解如何参与贡献。

## 致谢

Expand All @@ -126,6 +129,9 @@ MMClassification 是一款由不同学校和公司共同贡献的开源项目。
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab 光流估计工具箱与测试基准
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): 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 模型压缩工具箱与测试基准
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab 模型部署框架

## 欢迎加入 OpenMMLab 社区

Expand Down
147 changes: 86 additions & 61 deletions docs/en/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The compatible MMClassification and MMCV versions are as below. Please install t

| MMClassification version | MMCV version |
|:------------------------:|:---------------------:|
| master | mmcv>=1.3.16, <=1.5.0 |
| 0.19.0 | mmcv>=1.3.16, <=1.5.0 |
| dev | mmcv>=1.3.16, <=1.5.0 |
| 0.19.0 (master) | mmcv>=1.3.16, <=1.5.0 |
| 0.18.0 | mmcv>=1.3.16, <=1.5.0 |
| 0.17.0 | mmcv>=1.3.8, <=1.5.0 |
| 0.16.0 | mmcv>=1.3.8, <=1.5.0 |
Expand All @@ -29,92 +29,117 @@ The compatible MMClassification and MMCV versions are as below. Please install t
| 0.6.0 | mmcv>=1.1.4 |

```{note}
Since the `master` branch is under frequent development, the `mmcv`
Since the `dev` branch is under frequent development, the `mmcv`
version dependency may be inaccurate. If you encounter problems when using
the `master` branch, please try to update `mmcv` to the latest version.
the `dev` branch, please try to update `mmcv` to the latest version.
```

## Install MMClassification
## Install Dependencies

a. Create a conda virtual environment and activate it.
1. Create a conda virtual environment and activate it.

```shell
conda create -n open-mmlab python=3.8 -y
conda activate open-mmlab
```
```shell
conda create -n open-mmlab python=3.8 -y
conda activate open-mmlab
```

b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g.,
2. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g.,

```shell
conda install pytorch torchvision -c pytorch
```
```shell
conda install pytorch torchvision -c pytorch
```

```{note}
Make sure that your compilation CUDA version and runtime CUDA version match.
You can check the supported CUDA version for precompiled packages on the
[PyTorch website](https://pytorch.org/).
```
```{note}
Make sure that your compilation CUDA version and runtime CUDA version match.
You can check the supported CUDA version for precompiled packages on the
[PyTorch website](https://pytorch.org/).
```

`E.g.1` If you have CUDA 10.1 installed under `/usr/local/cuda` and would like to install
PyTorch 1.5.1, you need to install the prebuilt PyTorch with CUDA 10.1.
*E.g.1* If you have CUDA 10.1 installed under `/usr/local/cuda` and would like to install
PyTorch 1.5.1, you need to install the prebuilt PyTorch with CUDA 10.1.

```shell
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch
```
```shell
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch
```

`E.g.2` If you have CUDA 11.3 installed under `/usr/local/cuda` and would like to install
PyTorch 1.10.0., you need to install the prebuilt PyTorch with CUDA 11.3.
*E.g.2* If you have CUDA 11.3 installed under `/usr/local/cuda` and would like to install
PyTorch 1.10.1, you need to install the prebuilt PyTorch with CUDA 11.3.

```shell
conda install pytorch==1.10.0 torchvision==0.11.1 cudatoolkit=11.3 -c pytorch
```
```shell
conda install pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch
```

If you build PyTorch from source instead of installing the prebuilt package,
you can use more CUDA versions such as 9.0.
If you build PyTorch from source instead of installing the prebuilt package,
you can use more CUDA versions such as 9.0.

c. Install MMClassification repository.
3. Install MMCV

### Release version
MMCV is a foundational library for MMClassification. And there are two versions of MMCV.

We recommend you to install MMClassification with [MIM](https://github.com/open-mmlab/mim).
- **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.

```shell
pip install git+https://github.com/open-mmlab/mim.git
mim install mmcls
```
If you want to install mmcv-full, you can install/compile it according to the [instructions](https://mmcv.readthedocs.io/en/latest/get_started/installation.html).

MIM can automatically install OpenMMLab projects and their requirements,
and it can also help us to train, parameter search and pretrain model download.
A better choice is to use [MIM](https://github.com/open-mmlab/mim) to automatically select the mmcv-full version. MIM will automatically install mmcv-full when you use it to install MMClassification in the next section.

Or, you can install MMClassification with pip:
```shell
pip install openmim
```

```shell
pip install mmcls
```
## Install MMClassification repository

### Develop version
According to your needs, we support two install modes.

First, clone the MMClassification repository.
- [Use as a Python package](#use-as-a-python-package): In this mode, you just want to call MMClassification's APIs or import MMClassification's modules in your project.
- [Develop based on MMClassification (Recommended)](#develop-based-on-mmclassification): In this mode, you want to develop your own image classification task or new features based on MMClassification framework. For example, you want to add new dataset or new models. And you can use all tools we provided.

```shell
git clone https://github.com/open-mmlab/mmclassification.git
cd mmclassification
```
### Use as a Python package

And then, install build requirements and install MMClassification.
If you have installed MIM, simply use `mim install mmcls` to install
MMClassification. MIM will automatically install the mmcv-full which fits your
environment. In addition, MIM also has some other functions to help to do
training, parameter searching and model filtering, etc.

```shell
pip install -e . # or "python setup.py develop"
```
Or, you can use pip to install MMClassification with `pip install mmcls`. In
this situation, if you want to use mmcv-full, please install it manually in
advance.

```{note}
Following above instructions, MMClassification is installed on `dev` mode,
any local modifications made to the code will take effect without the need to
reinstall it (unless you submit some commits and want to update the version
number).
```
### Develop based on MMClassification

In this mode, any local modifications made to the code will take effect without
the need to reinstall it (unless you submit some commits and want to update the
version number).

1. Clone the MMClassification repository.

```shell
git clone https://github.com/open-mmlab/mmclassification.git
cd mmclassification
```

2. [Optional] Checkout to the `dev` branch.

```shell
git checkout dev
```

*Do I need to do this?* The `dev` branch is in development and includes some experimental functions. If you want these functions or want to contribute to MMClassification, do it.

3. Install requirements and MMClassification.

Use MIM, and MIM will automatically install the mmcv-full which fits your environment.
```shell
mim install -e .
```

Or use pip, and if you want to use mmcv-full, you need to install it manually in advance.

```shell
pip install -e .
```

### Another option: Docker Image
## Another option: Docker Image

We provide a [Dockerfile](https://github.com/open-mmlab/mmclassification/blob/master/docker/Dockerfile) to build an image.

Expand Down
Loading