window paddle dection安装记录(cuda 12.2,python3.10)

本文介绍了如何使用Conda创建PaddleDetection环境,根据CUDA版本安装PaddlePaddle,编译并进行模型测试,以及在GPU上快速体验目标检测。步骤包括克隆仓库、安装依赖、编译安装和测试代码示例,以及展示文本框计算过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.7/docs/tutorials/INSTALL_cn.md

conda创建环境

https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
在这里插入图片描述

根据cuda版本安装paddlepaddle:https://www.paddlepaddle.org.cn/
在这里插入图片描述

# 克隆PaddleDetection仓库
cd <path/to/clone/PaddleDetection>
git clone https://github.com/PaddlePaddle/PaddleDetection.git

# 安装其他依赖
cd PaddleDetection
pip install -r requirements.txt

# 编译安装paddledet
python setup.py install

测试

python ppdet/modeling/tests/test_architectures.py

测试通过后会提示如下信息:

.......
----------------------------------------------------------------------
Ran 7 tests in 12.816s
OK

在这里插入图片描述

快速体验目标检测效果

在GPU上预测一张图片

export CUDA_VISIBLE_DEVICES=0 # windows上不用加

python tools/infer.py -c configs/ppyolo/ppyolo_r50vd_dcn_1x_coco.yml -o use_gpu=true weights=https://paddledet.bj.bcebos.com/models/ppyolo_r50vd_dcn_1x_coco.pdparams --infer_img=demo/000000014439.jpg

在这里插入图片描述
在这里插入图片描述
更改visualizer.py的代码

计算文本框大小

bbox = draw.textbbox((0, 0), text)

计算文本宽度和高度

tw = bbox[2] - bbox[0]
th = bbox[3] - bbox[1]

结果:
在这里插入图片描述

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值