通过esp32cam拍摄图片上传至PC并通过YOLO进行目标检测

一.通过esp32cam拍摄照片并上传至PC

文章链接: https://blog.csdn.net/qq_62975494/article/details/131559263?spm=1001.2014.3001.5501

使用python作为服务端来接收传输的照片

二.训练自己的数据集

yolo训练自己的数据集: https://blog.csdn.net/qq_62975494/article/details/129786717?spm=1001.2014.3001.5501

三.AutoDL AI算力云的使用

由于自己计算机的算力不足我们可以使用云gpu来进行数据集的训练

1.账号注册

AutoDL官网: https://www.gpuhub.com/home
在这里插入图片描述

2.GPU选取

在这里插入图片描述

一般只有北京剩余机器较多新用户注册会赠送十元抵用券足够进行简单的训练

3.GPU使用

在这里插入图片描述

选择社区镜像搜索yolo选择自己需要的版本最后使用抵用券

4.开机训练

在这里插入图片描述
在这里插入图片描述

然后根据  二.训练自己的数据集中的内容进行配置和标注即可训练
上传数据集时需要将文件压缩后上传

四.数据集的使用


import torch
import bluetooth



# 加载本地模型
device = torch.device("cuda")
model = torch.hub.load('D:/AI/yolov7-main', 'custom',
                       'D:\AI\yolov7-main\weights\last2.pt',
                       source='local', force_reload=False)


while 1:

    if 1:
        # 使用模型
        model = model.to(device)
        # 开始推理
        results = model('./eyes.jpg')
        # 过滤模型
        xmins = results.pandas().xyxy[0]['xmin']
        ymins = results.pandas().xyxy[0]['ymin']
        xmaxs = results.pandas().xyxy[0]['xmax']
        ymaxs = results.pandas().xyxy[0]['ymax']
        class_list = results.pandas().xyxy[0]['class']
        confidences = results.pandas().xyxy[0]['confidence']
        newlist = []
        for xmin, ymin, xmax, ymax, classitem, conf in zip(xmins, ymins, xmaxs, ymaxs, class_list, confidences):
            if classitem == 0 and conf > 0.5:
                newlist.append([int(xmin), int(ymin), int(xmax), int(ymax), conf])
        print(newlist)
得到的newlist就是图片中检测到的目标的坐标和置信度

在这里插入图片描述

model = torch.hub.load('D:/AI/yolov7-main', 'custom',
                       '权重文件路径',
                       source='local', force_reload=False)

使用时将权重路径和模型路径改为自己本地路径

  • 17
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我把把C

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值