Ubuntu版本:
一定要注意版本对应!!!
conda create -n open-mmlab python=3.7
conda activate open-mmlab
#指定pytorch版本
conda install pytorch=1.8.0 torchvision cudatoolkit=10.1 -c pytorch
#指定pytorch和cuda的版本,mmcv一定要安装对应版本
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.8.0/index.html
#安装mmdetection,选择安装位置再git
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
python setup.py develop # or "pip install -v -e ."
测试
使用mmdetection文件夹下的demo测试
configs:resnest/mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco.py
到configs文件夹下的resnest文件夹下,点击README.md,下载对应预训练模型
在mmdetection文件夹下新建文件夹checkpoints,存放预训练模型
checkpoints:mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco_20200926_125503-8a2c3d47.pth
在终端输入
python demo/image_demo.py demo/demo.jpg configs/resnest/mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco.py checkpoints/mask_rcnn_s50_fpn_syncbn-backbone+head_mstrain_1x_coco_20200926_125503-8a2c3d47.pth
得到输出结果
相关链接:https://mmdetection.readthedocs.io/en/latest/get_started.html#install-mmdetection