旋转框目标检测mmrotate v1.0.0rc1 环境搭建(一)

Github官方链接

Step 1.创建conda环境并激活

conda create -n mmrotatev1  python=3.8 -y 
source activate mmrotatev1

Step 2.按照官方说明安装 PyTorch

pip3 install torch==1.8.2+cu102 torchvision==0.9.2+cu102 torchaudio===0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

#验证是否安装成功

>>> import torchvision
>>> import torch
>>> import.__version__
  File "", line 1
    import.__version__
          ^
SyntaxError: invalid syntax
>>> torch.__version__
'1.8.2+cu102'

Step 3. Install MMEngine and MMCV using MIM.

pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0rc2"

pip install "mmcv>=2.0.0rc2" -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com #(镜像加速安装)

Step 4. Install MMDetection as a dependency.

mim install 'mmdet>=3.0.0rc2'

Optionally, you could also build MMDetection from source in case you want to modify the code:

git clone https://github.com/open-mmlab/mmdetection.git -b dev-3.x
# "-b dev-3.x" means checkout to the `dev-3.x` branch.
cd mmdetection
pip install -v -e .
# "-v" means verbose, or more output
# "-e" means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

Step 5. Install MMRotate.

git clone https://github.com/open-mmlab/mmrotate.git -b dev-1.x
# "-b dev-1.x" means checkout to the `dev-1.x` branch.
cd mmrotate
pip install -r requirements/build.txt
pip install -v -e .  # or "python setup.py develop"
# "-v" means verbose, or more output
# "-e" means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

Case b: If you use mmrotate as a dependency or third-party package, install it with pip:

pip install mmrotate

或者
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com 
python setup.py develop

Step 6.Verify the installation

python demo/image_demo.py  demo/demo.jpg  configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_1x_dota.py  checkpoints/Oriented_RCNN/oriented_rcnn_r50_fpn_1x_dota_le90.pth 
旋转框目标检测mmrotate v1.0.0rc1 环境搭建(一)_第1张图片

你可能感兴趣的:(MMroteate,深度学习,人工智能,python)