From e33f7f1ae80cef9500dcc5707d12883eb6be0cf2 Mon Sep 17 00:00:00 2001 From: Kenny Date: Thu, 10 Jun 2021 22:25:30 +0800 Subject: [PATCH] update doc --- README.md | 76 +++++++++----------------------------------- docs/installation.md | 65 +++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 61 deletions(-) create mode 100644 docs/installation.md diff --git a/README.md b/README.md index 57b63ef..0aa693e 100644 --- a/README.md +++ b/README.md @@ -2,68 +2,23 @@ MIM provides a unified API for launching and installing OpenMMLab projects and their extensions, and managing the OpenMMLab model zoo. +## Major Features + +- **Package Management** + + You can use MIM to manage OpenMMLab codebases, install or uninstall them conveniently. + +- **Checkpoint Management** + + You can use MIM to access all checkpoints in OpenMMLab, download checkpoints, look up checkpoints that meet your need. + +- **Script Calling** + + You can call training scripts, testing scripts and any other scripts under the `tools` directory of a specific codebase conveniently at anywhere. Calling scripts via MIM is more flexible and efficient (The command will be much shorter, check [abbreviation.md](docs/abbreviation.md)). + ## Installation -1. Create a conda virtual environment and activate it. - - ```bash - conda create -n open-mmlab python=3.7 -y - conda activate open-mmlab - ``` - -2. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g., - - ```bash - 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/). - -3. Install MIM - - + from pypi - - ```bash - pip install openmim - ``` - - + from source - - ```bash - git clone https://github.com/open-mmlab/mim.git - cd mim - pip install -e . - # python setup.py develop or python setup.py install - ``` - -4. Auto completion (Optional) - - In order to activate shell completion, you need to inform your shell that completion is available for your script. - - + For Bash, add this to ~/.bashrc: - - ```bash - eval "$(_MIM_COMPLETE=source mim)" - ``` - - + For Zsh, add this to ~/.zshrc: - - ```bash - eval "$(_MIM_COMPLETE=source_zsh mim)" - ``` - - + For Fish, add this to ~/.config/fish/completions/mim.fish: - - ```bash - eval (env _MIM_COMPLETE=source_fish mim) - ``` - - Open a new shell to enable completion. Or run the eval command directly in your current shell to enable it temporarily. - - The above eval command will invoke your application every time a shell is started. This may slow down shell startup time significantly. - - Alternatively, you can activate the script. Please refer to [activation-script](https://click.palletsprojects.com/en/7.x/bashcomplete/#activation-script) +Please refer to [installation.md](docs/installation.md) for installation. ## Command @@ -118,7 +73,6 @@ MIM provides a unified API for launching and installing OpenMMLab projects and t
2. uninstall - [![asciicast](https://asciinema.org/a/416948.svg)](https://asciinema.org/a/416948) + command diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..03d487c --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,65 @@ +## Installation + +### Prepare Environment + +1. Create a conda virtual environment and activate it. + + ```bash + conda create -n open-mmlab python=3.7 -y + conda activate open-mmlab + ``` + +2. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g., + + ```bash + 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/). + +### Install MIM + ++ from pypi + + ```bash + pip install openmim + ``` + ++ from source + + ```bash + git clone https://github.com/open-mmlab/mim.git + cd mim + pip install -e . + # python setup.py develop or python setup.py install + ``` + +### Optional Features + +1. Auto completion + + In order to activate shell completion, you need to inform your shell that completion is available for your script. + + + For Bash, add this to ~/.bashrc: + + ```bash + eval "$(_MIM_COMPLETE=source mim)" + ``` + + + For Zsh, add this to ~/.zshrc: + + ```bash + eval "$(_MIM_COMPLETE=source_zsh mim)" + ``` + + + For Fish, add this to ~/.config/fish/completions/mim.fish: + + ```bash + eval (env _MIM_COMPLETE=source_fish mim) + ``` + + Open a new shell to enable completion. Or run the eval command directly in your current shell to enable it temporarily. + + The above eval command will invoke your application every time a shell is started. This may slow down shell startup time significantly. + + Alternatively, you can activate the script. Please refer to [activation-script](https://click.palletsprojects.com/en/7.x/bashcomplete/#activation-script).