项目简介
基于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_4
current = 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:
#