1.安装pytorch
pip install torch==1.8.1 -i https://pypi.douban.com/simple/
pip install torchvision==0.9.1 -i https://pypi.douban.com/simple/
2.安装 mmcv (cuda与torch版本号可自行修改)
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8.1/index.html
3.安装 mmdetection
cd '/home/xzz/Swin-Transformer-Object-Detection-master'
pip install -r requirements.txt -i https://pypi.douban.com/simple/
python setup.py develop
4.安装apex
cd apex-master
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .
或者自己下载:
git clone https://github.com/NVIDIA/apex
cd apex
python setup.py install --cpp_ext
5.运行
python demo/image_demo.py demo/demo.jpg configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py mask_rcnn_swin_tiny_patch4_window7.pth