当前位置: 首页 > wzjs >正文

温岭 网站建设seo百度seo排名优化软件

温岭 网站建设,seo百度seo排名优化软件,手机ps软件如何做ppt下载网站,php除了做网站还能做什么项目简介 基于Yolo11的无人机小目标检测系统的设计与性能优化改进的目标检测 项目名称 基于Yolo11的无人机小目标检测系统的设计与性能优化改进 项目简介 该项目旨在开发一个基于YOLO11的无人机目标检测系统,能够实时识别并定位无人机拍摄过程中捕捉的小目标。…

项目简介

基于Yolo11的无人机小目标检测系统的设计与性能优化改进的目标检测

项目名称

基于Yolo11的无人机小目标检测系统的设计与性能优化改进

项目简介

该项目旨在开发一个基于YOLO11的无人机目标检测系统,能够实时识别并定位无人机拍摄过程中捕捉的小目标。考虑到无人机拍摄的目标通常较小,系统将采用特定的调优策略,以提高小目标的检测精度和召回率。

数据

数据集下载

https://github.com/VisDrone/VisDrone-Dataset

数据预处理

1.获取数据集的labels目标框标签

  • 训练集数据

from PIL import Image
from tqdm import tqdm
from pathlib import Path
import os
def labelsplit(path):# 假设 dir 是一个 Path 对象,指向你想要处理的目录# 获取当前路径# d:\huaqing\code\detect_plane_project_4current = os.path.dirname(__file__)txt_dir = os.path.join(current, 'datasets', path, 'annotations')img_dir = os.path.join(current, 'datasets', path, 'images')labels_dir = os.path.join(current, 'datasets', path, 'labels')
​# 转化为相对路径# txt的文件路径txt_path = os.path.relpath(txt_dir)img_path = os.path.relpath(img_dir)labels_path = os.path.relpath(labels_dir)
​
​txt_path = Path(txt_path)# 遍历txt文件夹下的所有txt文件# pbar = os.listdir(txt_path)pbar = tqdm((txt_path).glob('*.txt'), desc=f'Converting {txt_path}')for f in pbar:# 【对图片的操作】# 构建对应的图像文件路径并获取尺寸txt_name = f.name.split('.')[0]img_path_jpg = Path(os.path.join(img_path, f.name)).with_suffix('.jpg')    img_size = Image.open(img_path_jpg).size
​# 路径是否存在检测if not (os.path.exists(img_path) and os.path.exists(img_path) and os.path.exists(labels_path) and os.path.exists(img_path_jpg)):print("Warning: Image file not found")
​
​lines = []with open(f, 'r') as file:# read annotation.txtfor row in [x.split(',') for x in file.read().strip().splitlines()]:# 0表示无效狂,所以舍去if row[4] == '0':  # VisDrone 'ignored regions' class 0continue# 目标1索引cls = int(row[5]) - 1# # 中心点坐标center_x = (float(row[0]) + (float(row[2]) / 2)) / img_size[0]center_y = (float(row[1]) + (float(row[3]) / 2)) / img_size[1]labels_txt = str(cls) + ' ' + str(center_x) + ' ' + str(center_y) + ' ' + str(float(row[2]) / img_size[0]) + ' ' + str(float(row[3]) / img_size[1])lines.append(labels_txt)with open(os.path.join(labels_path, txt_name + '.txt'), 'w') as file:for i in range(len(lines)):file.write(lines[i])file.write('\n')file.close()
​
if __name__ == '__main__':labelsplit('VisDrone2019-DET-train')
  • 测试集数据(修改传入的文件路径,其余代码一致)

if __name__ == '__main__':labelsplit('VisDrone2019-DET-val')

模型训练

编写数据集的配置文件

# Ultralytics YOLO 🚀, AGPL-3.0 license
# VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University
# Documentation: https://docs.ultralytics.com/datasets/detect/visdrone/
# Example usage: yolo train data=VisDrone.yaml
# parent
# ├── ultralytics
# └── datasets
#     └── VisDrone  ← downloads here (2.3 GB)
​
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ./datasets # dataset root dir
train: VisDrone2019-DET-train # train images (relative to 'path')  6471 images
val: VisDrone2019-DET-val # val images (relative to 'path')  548 images
test: VisDrone2019-DET-test-dev # test images (optional)  1610 images
​
# Classes
names:0: pedestrian1: people2: bicycle3: car4: van5: truck6: tricycle7: awning-tricycle8: bus9: motor10.other

修改模型的检测分类数

  • 车牌目标检测只检测车牌,因此模型输出分类数为1

nc: 10  # number of classes

模型参数的修改

# 1.【增加网络层】
# YOLO11n backbone
backbone:# [from, repeats, module, args]- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4- [-1, 2, C3k2, [256, False, 0.25]]- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8- [-1, 2, C3k2, [512, False, 0.25]]- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16- [-1, 2, C3k2, [512, True]]- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32- [-1, 2, C3k2, [1024, True]]- [-1, 2, CBAM, [1024, 7]] # 新增CBAM,后面的层级自然都+1- [-1, 1, SPPF, [1024, 5]] # 9- [-1, 2, C2PSA, [1024]] # 10
​
#2.【修改网络层级关系,因为是在第九层加入的CBAM,所以九层以后的层级需要加一层】
# YOLO11n head
head:- [-1, 1, nn.Upsample, [None, 2, "nearest"]]- [[-1, 6], 1, Concat, [1]] # cat backbone P4- [-1, 2, C3k2, [512, False]] # 13
​- [-1, 1, nn.Upsample, [None, 2, "nearest"]]- [[-1, 4], 1, Concat, [1]] # cat backbone P3- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
​- [-1, 1, Conv, [256, 3, 2]]- [[-1, 14], 1, Concat, [1]] # cat head P4 13->14- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
​- [-1, 1, Conv, [512, 3, 2]]- [[-1, 11], 1, Concat, [1]] # cat head P5 10->11- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
​- [[17, 20, 23], 1, Detect, [nc]] # Detect(P3, P4, P5)
16->17 19->20 22->23
# 3.【yolo11本身写有CBAM,所以只需要逐层将其导出就行】

训练模型权重

yolo detect train data=cfg\datasets\VisDrone.yamlmodel=ultralytics\ultralytics\cfg\models\11\yolo11m.yaml  epochs=30 imgsz=640

训练过程可视化

  • 不同训练轮次下各类训练指标的折线图

  • 第一幅图:在不同的分类中的训练预测出的数量,其中车辆的检测目标最多,摩托车检测的数据最少

  • 第二幅图:预测框的形状情况,由图可以看出小中目标居多

  • 第三幅图:预测框的中心坐标的分布情况

  • 第四幅图:预测框的长宽分布情况

模型验证

yolo detect val model=.\runs\detect\train23\weights\best.pt data=.\data\VisDrone.yaml

模型应用

模型加载并使用

from ultralytics import YOLO
​
model = YOLO(r'..\runs\detect\trian22\weights\best.pt')
model.predict(r"..\datasets\VisDrone2019-DET-test-challenge\images\0000000_02309_d_0000006.jpg", save=True)

http://www.dtcms.com/wzjs/787.html

相关文章:

  • 外币信用卡怎么做网站上用企业seo顾问服务
  • 徐州市住房和城乡建设局网站首页网站的seo方案
  • 上海怎么做网站十大接单推广app平台
  • 广州建设网站的公司简介搜索引擎营销的优缺点
  • 哪个网站做签约插画师好百度词条官网入口
  • 网络推广软件排行网站推广seo教程
  • 要做未来科技的网站怎么做seo查询软件
  • 怎么在网站后台做图片新闻全网优化哪家好
  • 网站制作的语言网络软文范例
  • 网站建设平台招商重庆森林百度云
  • 为什么很多公司没自己的网站知乎关键词排名优化
  • 济南seo网站排名优化工具国内十大软件培训机构
  • 深圳前海自贸区注册公司政策北京搜索引擎优化seo专员
  • 网站线框图用什么做seo二级目录
  • 专业定制网站建设智能优化软文网站
  • jsp 移动web网站开发crm客户管理系统
  • 西安做网站哪家最便宜广州抖音推广
  • wordpress超好看主题奉节县关键词seo排名优化
  • 自做业务网站电商网站入口
  • 网站二级菜单是什么原因百度竞价开户3000
  • 龙岗这边哪里有教做网站的谷歌搜索引擎google
  • 做美甲批发的都上什么网站营销策划推广
  • 罗湖网站建设公司乐云seo最经典最常用的网站推广方式
  • 陕西省建设业协会网站合肥网络关键词排名
  • 十大免费客户管理系统佛山百度seo代理
  • 房产网站的全景图怎么做0元做游戏代理
  • 做网站后台指的那网站优化的方法与技巧
  • 一个人制作网站深圳seo优化排名推广
  • 专业pc网站建设服务沈阳优化网站公司
  • 电信网站开发语言主要用什么类似58的推广平台有哪些平台