yolov5目标检测gpu加速

该项目使用yolov5进行目标检测,并且可以选择使用手机或者电脑摄像头,以及是否使用GPU加速推理。
博客最后附有代码下载链接。

界面相关:
在这里插入图片描述
视频效果:

yolov5 gpu目标检测

b站地址

yolov5主要是参考这位巨佬的代码,如有需要可前往自行下载(无界面版)。

下面分享一下主要的界面代码。

import sys, cv2
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5 import QtGui,QtWidgets
import sys, cv2, time
from untitled import Ui_Form
import cv2 as cv
import numpy as np

import time

import cv2
import numpy as np
from PIL import Image
from yolo import YOLO

class Mywindow(QtWidgets.QWidget,Ui_Form): #这个窗口继承了用QtDesignner 绘制的窗口

    def __init__(self):
        super(Mywindow,self).__init__()
        self.setupUi(self)
        self.use_palette()
        # 设置定时器
        self._timer = QTimer(self)
        self._timer.timeout.connect(self.play)



        #单选按钮分组
        self.bg1=QButtonGroup(self)
        self.bg1.addButton(self.radioButton_3,1)
        self.bg1.addButton(self.radioButton_4,2)
        self.radioButton_3.setChecked(True)

        self.bg2 = QButtonGroup(self)
        self.bg2.addButton(self.radioButton_5, 3)
        self.bg2.addButton(self.radioButton_6, 4)
        self.radioButton_5.setChecked(True)

        self.yolo = 
  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值