截至目前 由于mmdetection 对win支持还属于实验阶段,因此建议配置版本不能超过mmdetection2.7, 超过此版本的mmcv-full无win版本支持。

安装步骤:
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch -y
# install the latest mmcv
pip install mmcv-full=={version} -f https://download.openmmlab.com/mmcv/dist/index.html
# install mmdetection
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e .
测试程序:
from mmdet.apis import init_detector, inference_detector config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py' # download the checkpoint from model zoo and put it in `checkpoints/` # url: https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth' device = 'cuda:0' # init a detector model = init_detector(config_file, checkpoint_file, device=device) # inference the demo image inference_detector(model, 'demo/demo.jpg')
本文档介绍了如何在Windows环境下安装和配置mmdetection,建议使用不超过v2.7的版本,因为高版本的mmcv-full暂不支持Windows。首先,创建conda环境并安装指定版本的PyTorch和CUDAToolkit。接着,通过pip安装mmcv-full和mmdetection,并提供了一个测试程序来验证安装是否成功。测试程序包括初始化模型、进行推断等步骤。
1万+

被折叠的 条评论
为什么被折叠?



