博主介绍:✌全网粉丝50W+,前互联网大厂软件研发、集结硕博英豪成立工作室。专注于计算机相关专业项目实战8年之久,选择我们就是选择放心、选择安心毕业✌
> 🍅想要获取完整文章或者源码,或者代做,拉到文章底部即可与我联系了。🍅🍅感兴趣的可以先收藏起来,点赞、关注不迷路,大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助同学们顺利毕业 。🍅
1、毕业设计:2026年计算机专业毕业设计选题汇总(建议收藏)✅
2、大数据毕业设计:2026年选题大全 深度学习 python语言 JAVA语言 hadoop和spark(建议收藏)✅
1、项目介绍
技术栈:
python语言、YOLOv8模型、PyQt5界面、opencv、pytorch
一、数据集介绍
数据集总共包含以下类别,且已经分好 train、val、test文件夹,也提供转好的yolo格式的标注文件,可以直接训练使用。
2、项目界面
(1)检测识别

(2)检测识别

(3)检测识别

(4)检测识别

(5)检测识别

(6)检测识别

(7)检测识别

3、项目说明
技术栈:
python语言、YOLOv8模型、PyQt5界面、opencv、pytorch
一、数据集介绍
数据集总共包含以下类别,且已经分好 train、val、test文件夹,也提供转好的yolo格式的标注文件,可以直接训练使用。
4、核心代码
import cv2
def update_center_points(data, dic_center_points):
'''
更新坐标
'''
for row in data:
x1, y1, x2, y2, cls_name, conf, obj_id = row[:7]
# 计算中心点坐标
center_x = int((x1 + x2) / 2)
center_y = int((y1 + y2) / 2)
# 更新字典
if obj_id in dic_center_points:
# 判断列表长度是否超过30
if len(dic_center_points[obj_id]) >= 30:
dic_center_points[obj_id].pop(0)
dic_center_points[obj_id].append((center_x, center_y))
else:
dic_center_points[obj_id] = [(center_x, center_y)]
return dic_center_points
def res2OCres(results):
lst_res = []
if results is None:
return lst_res
for res in results.tolist():
box = res[:4]
conf = res[-2]
cls = res[-1]
lst_res.append([cls, conf, box])
return list(lst_res)
def compute_color_for_labels(label):
palette = (2 ** 11 - 1, 2 ** 15 - 1, 2 ** 20 - 1)
"""
Simple function that adds fixed color depending on the class
"""
color = [int((p * (label ** 2 - label + 1)) % 255) for p in palette]
return tuple(color)
def draw_text_with_red_background(image, text, position, font=cv2.FONT_HERSHEY_SIMPLEX, font_scale=1, thickness=2):
# 获取文本的大小
(text_width, text_height), _ = cv2.getTextSize(text, font, font_scale, thickness)
# 计算矩形背景的大小和位置
background_width = text_width + 10
background_height = text_height + 10
background_position = (position[0] - 5, position[1] - text_height - 5)
# 在图像上绘制红色背景矩形
cv2.rectangle(image, background_position, (background_position[0] + background_width, background_position[1] + background_height), (0, 0, 255), cv2.FILLED)
# 计算文本的居中位置
text_x = background_position[0] + int((background_width - text_width) / 2)
text_y = background_position[1] + int((background_height + text_height) / 2)
# 在图像上绘制文本
cv2.putText(image, text, (text_x, text_y), font, font_scale, (255, 255, 255), thickness, cv2.LINE_AA)
return image
def draw_info(frame, results):
for i, txt in enumerate(results):
# cv2.putText(frame, txt[0], (30, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0), 2)
frame = draw_text_with_red_background(frame, txt[0], (0, 30), font=cv2.FONT_HERSHEY_SIMPLEX, font_scale=1, thickness=2)
return frame
5、源码获取方式
biyesheji0005 或 biyesheji0001 (绿色聊天软件)
🍅由于篇幅限制,获取完整文章或源码、代做项目的,查看我的【用户名】、【专栏名称】、【顶部选题链接】就可以找到我啦🍅
感兴趣的可以先收藏起来,点赞、关注不迷路,下方查看👇🏻获取联系方式👇🏻

5690

被折叠的 条评论
为什么被折叠?



