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

石排仿做网站邢台123最新求职招聘信息

石排仿做网站,邢台123最新求职招聘信息,凡科做的网站怎么样,企业创建网站的途径都有啥⭐⭐ YOLOv8改进专栏|包含主干、模块、注意力机制、检测头等前沿创新 ​ ⭐⭐ YOLOv8可视化界面如下 使用需要安装opencv-python、torch、numpy及PySide6(python版本3.9) pip install PySide6 pip install numpy pip install opencv-python 使用说明 运行下方代码#xf… ⭐⭐ YOLOv8改进专栏|包含主干、模块、注意力机制、检测头等前沿创新 ​ ⭐⭐ YOLOv8可视化界面如下 使用需要安装opencv-python、torch、numpy及PySide6(python版本3.9) pip install PySide6 pip install numpy pip install opencv-python 使用说明 运行下方代码会出现如图所示界面选择视频文件左边即可播放视频。选择摄像头。左侧开始实时展示摄像头画面需要电脑含有摄像头选择模型即开始检测可先选择模型第一次检测会加载模型会有一点卡顿。 import os import cv2 import torch import numpy as npfrom PySide6.QtGui import QIcon from PySide6 import QtWidgets, QtCore, QtGuifrom ultralytics import YOLOclass MyWindow(QtWidgets.QMainWindow):def __init__(self):super().__init__()self.init_gui()self.model Noneself.timer QtCore.QTimer()self.timer1 QtCore.QTimer()self.cap Noneself.video Noneself.timer.timeout.connect(self.camera_show)self.timer1.timeout.connect(self.video_show)def init_gui(self):self.setFixedSize(960, 440)self.setWindowTitle(Bilibili秋芒时不知)self.setWindowIcon(QIcon(️ ))centralWidget QtWidgets.QWidget(self)self.setCentralWidget(centralWidget)mainLayout QtWidgets.QVBoxLayout(centralWidget)topLayout QtWidgets.QHBoxLayout()self.oriVideoLabel QtWidgets.QLabel(self)self.detectlabel QtWidgets.QLabel(self)self.oriVideoLabel.setMinimumSize(448, 336)self.detectlabel.setMinimumSize(448, 336)self.oriVideoLabel.setStyleSheet(border:1px solid #D7E2F9;)self.detectlabel.setStyleSheet(border:1px solid #D7E2F9;)# 960 540 1920 960topLayout.addWidget(self.oriVideoLabel)topLayout.addWidget(self.detectlabel)mainLayout.addLayout(topLayout)# 界面下半部分 输出框 和 按钮groupBox QtWidgets.QGroupBox(self)bottomLayout QtWidgets.QVBoxLayout(groupBox)mainLayout.addWidget(groupBox)btnLayout QtWidgets.QHBoxLayout()self.selectModel QtWidgets.QPushButton(选择模型)self.selectModel.setFixedSize(100, 50)self.selectModel.clicked.connect(self.load_model)self.openVideoBtn QtWidgets.QPushButton(️视频文件)self.openVideoBtn.setFixedSize(100, 50)self.openVideoBtn.clicked.connect(self.start_video)self.openVideoBtn.setEnabled(False)self.openCamBtn QtWidgets.QPushButton(摄像头)self.openCamBtn.setFixedSize(100, 50)self.openCamBtn.clicked.connect(self.start_camera)self.stopDetectBtn QtWidgets.QPushButton(停止)self.stopDetectBtn.setFixedSize(100, 50)self.stopDetectBtn.setEnabled(False)self.stopDetectBtn.clicked.connect(self.stop_detect)self.exitBtn QtWidgets.QPushButton(⏹退出)self.exitBtn.setFixedSize(100, 50)self.exitBtn.clicked.connect(self.close)btnLayout.addWidget(self.selectModel)btnLayout.addWidget(self.openVideoBtn)btnLayout.addWidget(self.openCamBtn)btnLayout.addWidget(self.stopDetectBtn)btnLayout.addWidget(self.exitBtn)bottomLayout.addLayout(btnLayout)def start_camera(self):self.timer1.stop()if self.cap is None:self.cap cv2.VideoCapture(0, cv2.CAP_DSHOW)if self.cap.isOpened():# exit()self.timer.start(50)passself.stopDetectBtn.setEnabled(True)def camera_show(self):ret, frame self.cap.read()if ret:if self.model is not None:frame cv2.resize(frame, (448, 352))frame1 self.model(frame, imgsz[448, 352], devicecuda) if torch.cuda.is_available() \else self.model(frame, imgsz[448, 352], devicecpu)frame1 cv2.cvtColor(frame1[0].plot(), cv2.COLOR_RGB2BGR)frame1 QtGui.QImage(frame1.data, frame1.shape[1], frame.shape[0], QtGui.QImage.Format_RGB888)self.detectlabel.setPixmap(QtGui.QPixmap.fromImage(frame1))frame cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)frame QtGui.QImage(frame.data, frame.shape[1], frame.shape[0], QtGui.QImage.Format_RGB888)self.oriVideoLabel.setPixmap(QtGui.QPixmap.fromImage(frame))self.oriVideoLabel.setScaledContents(True)else:passdef start_video(self):if self.timer.isActive():self.timer.stop()fileName, fileType QtWidgets.QFileDialog.getOpenFileName(self, 选取视频文件, filter*.mp4)if os.path.isfile(fileName):# capture cv2.VideoCapture(fileName)# frame_count int(capture.get(cv2.CAP_PROP_FRAME_COUNT))self.video cv2.VideoCapture(fileName)fps self.video.get(cv2.CAP_PROP_FPS)self.timer1.start(int(1/fps))else:print(Reselect video)def video_show(self):ret, frame self.video.read()if ret:if self.model is not None:frame cv2.resize(frame, (448, 352))frame1 self.model(frame, imgsz[448, 352], devicecuda) if torch.cuda.is_available() \else self.model(frame, imgsz[448, 352], devicecpu)frame1 cv2.cvtColor(frame1[0].plot(), cv2.COLOR_RGB2BGR)frame1 QtGui.QImage(frame1.data, frame1.shape[1], frame.shape[0], QtGui.QImage.Format_RGB888)self.detectlabel.setPixmap(QtGui.QPixmap.fromImage(frame1))frame cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)frame QtGui.QImage(frame.data, frame.shape[1], frame.shape[0], QtGui.QImage.Format_RGB888)self.oriVideoLabel.setPixmap(QtGui.QPixmap.fromImage(frame))self.oriVideoLabel.setScaledContents(True)else:self.timer1.stop()img cv2.cvtColor(np.zeros((500, 500), np.uint8), cv2.COLOR_BGR2RGB)img QtGui.QImage(img.data, img.shape[1], img.shape[0], QtGui.QImage.Format_RGB888)self.oriVideoLabel.setPixmap(QtGui.QPixmap.fromImage(img))self.detectlabel.setPixmap(QtGui.QPixmap.fromImage(img))self.video.release()self.video Nonedef load_model(self):fileName, fileType QtWidgets.QFileDialog.getOpenFileName(self, 选取模型权重, filter*.pt)if fileName.endswith(.pt):self.model YOLO(fileName)else:print(Reselect model)self.openVideoBtn.setEnabled(True)self.stopDetectBtn.setEnabled(True)def stop_detect(self):if self.timer.isActive():self.timer.stop()if self.timer1.isActive():self.timer1.stop()if self.cap is not None:self.cap.release()self.cap Noneself.video Noneimg cv2.cvtColor(np.zeros((500, 500), np.uint8), cv2.COLOR_BGR2RGB)img QtGui.QImage(img.data, img.shape[1], img.shape[0], QtGui.QImage.Format_RGB888)self.oriVideoLabel.setPixmap(QtGui.QPixmap.fromImage(img))self.detectlabel.setPixmap(QtGui.QPixmap.fromImage(img))def close(self):if self.cap is not None:self.cap.release()self.cap Noneif self.timer.isActive():self.timer.stop()exit()if __name__ __main__:app QtWidgets.QApplication()window MyWindow()window.show()app.exec() 效果展示
http://www.hkea.cn/news/14362670/

相关文章:

  • 申请好域名后怎么建设网站网站后台素材
  • 哈尔滨网页设计网站模板网站模板 源码之家
  • 网站建设哪儿济南兴田德润什么活动网站建设公司模版
  • 1核1g服务器做网站江山市建设局网站
  • 北京seo排名优化网站拼多多怎么申请开店
  • 黄冈智能网站建设平台手机下载视频网站模板下载失败
  • 怎么查看一个网站是不是伪静态小说网站开发的目的
  • 沈阳餐饮网站建设html网站编辑器
  • 深圳企业建网站云服务器优惠活动
  • 国外做外贸哪个网站好些上海建筑公司名称大全
  • 生活家装饰官方网站惠州网站网站建设
  • 好用的在线地图网站小程序开发制作官网
  • 绿化信息网站建设河南省交通基本建设质量检测监督站网站
  • 免费企业网站模板源码如何快速网站备案
  • 建个企业网站要多少钱微信开发者工具文档
  • 个人网站如何备企业开发者模式关掉好还是开着好
  • 专门做验收报告的网站域名注册服务网站查询
  • 中企动力做的网站怎么登陆wordpress如何发布视频
  • 线上网站制作wordpress 主题 开源
  • 烟台建网站哪家好公共资源交易中心怎么报名投标
  • 企业在网站推广wordpress插件找回
  • 网站建设 贸易企业所得税会计分录
  • 外贸网站索引页多it培训机构学费
  • 网站 建设 步骤wordpress加统计代码
  • 校园网站建设情况邮件服务器是不是网站服务器
  • 做餐饮连锁在哪个网站看泰安网站建设找工作
  • 做网站套路网站广告下悬浮代码怎么做
  • 可信网站认证服务商匿名留言墙 wordpress
  • 建站公司兴田德润好不好苏州网站推广建设
  • 神木自适应网站开发网站的用户注册怎么做