无脑015——windows 安装mmdetection

编程入门 行业动态 更新时间:2024-10-25 08:23:28

无脑015——<a href=https://www.elefans.com/category/jswz/34/1771365.html style=windows 安装mmdetection"/>

无脑015——windows 安装mmdetection

首先创建conda环境

conda create -n mmdet_torch171 python=3.8
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.1 -c pytorch
conda activate mmdet_torch171
pip install pillow==8.0

然后安装openmim

pip install -U openmim
mim install mmengine

#因为不支持torch1.12以上,所以自己去这个网站找mmcv的版本
.x/get_started/installation.html

pip install mmcv==2.0.0rc4 -f .7/index.html

手动下载mmdetection的包,解压到
G:\bsh\mmdet_torch171
进入目录,开始安装

 cd .\bsh\mmdet_torch171\pip install -v -e .

安装成功之后显示:

Successfully installed mmdet-3.2.0 pycocotools-2.0.7 scipy-1.10.1 shapely-2.0.2 terminaltables-3.1.10

验证安装结果

输入
mim download mmdet --config rtmdet_tiny_8xb32-300e_coco --dest .
输出
Successfully downloaded rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth to G:\bsh\mmdet_torch171
Successfully dumped rtmdet_tiny_8xb32-300e_coco.py to G:\bsh\mmdet_torch171

完成后,你会在当前文件夹中发现两个文件 rtmdet_tiny_8xb32-300e_coco.py 和 rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth

输入
python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cuda
输出
results have been saved at outputs
可以去outputs查看输出的文件,会在当前文件夹中的 outputs/vis 文件夹中看到一个新的图像 demo.jpg,图像中包含有网络预测的检测框。

至此,环境测试完成,可以正常使用

更多推荐

无脑015——windows 安装mmdetection

本文发布于:2023-12-03 17:02:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1656869.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:windows   mmdetection

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!