模型介绍
中文整理模型描述:模型基于yolov8的基础预训练版本
数据:1000张安全衣与普通衣服标注数据
模型预测代码
import cv2
from yolo net import YOLO
##加载训练保存好的最优权重的模型
model = YOLO("runs/detect/train10/weights/last.pt")
input video = cv2.VideoCapture('predict img video/test video.mp4')
output video = cv2.VideoWriter('output video.mp4', cv2.VideoWriter fourcc(*'mp4v'), input video.get(cv2.CAP PROP FPS), (int(input video.get(cv2.CAP PROP FRAME WIDTH)), int(input video.get(cv2.CAP PROP FRAME HEIGHT))))
while True:
ret, frame = input video.read()
if not ret:
break
## 对帧进行预测
predictions = model.predict(frame)
# 将预测结果绘制到帧上并保存到输出视频对象中
output frame = frame.copy()
for detection in predictions:
output frame = detection.plot()
output video.write(output frame)
cv2.imshow('Output Video', output frame)
if cv2.waitKey(1) & 0xFF == ord('q'): # 按 'q' 键退出处理过程
break
input video.release() # 释放输入视频对象资源
output video.release() # 释放输出视频对象资源
cv2.destroyAllWindows() # 关闭所有OpenCV窗口
优先采用原作者提供的中文模型卡片;仅有英文说明时由闲社AI翻译整理。重要参数、许可证和商用范围请以原文为准。
你将获得什么
完整仓库方式包含该固定版本中的权重、配置、分词器及说明文件;指定版本方式只下载所选文件或整组分片。多模态模型的投影文件、配置等依赖,请按作者说明配齐。
完整仓库可能包含多个权重格式,因此需要的磁盘空间可能大于单一格式的模型大小。下载文件不等于完成模型部署。
使用前须知
运行模型需要的设备、工具与依赖,以原作者说明为准。
是否允许商用、修改和分发,请查看模型许可证。
闲社提供资料与镜像下载方法,不代表已运行模型或完成安全审计。下载的代码应先检查,再执行。
Problem with the information or download?
Sign in to submit feedback.
