MMDetecton安装

本文详细指导如何在Ubuntu环境下安装MMDetection库,包括设置Python环境、配置PyTorch及MMCV,演示了如何下载预训练模型并进行mask_rcnn的图像检测。适合深度学习初学者和开发者快速上手。
摘要由CSDN通过智能技术生成

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值