PYQT5目标检测
最近学习pyqt5,简单的写了一些小工具,因为也在学习目标检测 ,所以写了一个从本地导入视频进行目标检测的一个小demo
下面是布局的控件代码 使用的绝对布局
self.setWindowTitle("检测")
self.resize(450,500)
self.label1=QLabel("Waiting for the video file...",self)
self.label1.move(20,10)
self.label1.resize(400, 400)
self.label1.setAlignment(Qt.AlignCenter)#这个是显示label中文字的居中显示
self.label1.setStyleSheet("QLabel{background:black;}"
"QLabel{color:rgb(255,255,255,150);font-size:20px;font-weight:bold;font-family:Roman times;}"
)
layout=QHBoxLayout()
self.button1=QPushButton("选择视频路径",self)
self.button1.move(20,420)
self.button1.clicked.connect(self.getfile)
self.linedit=QLineEdit(self)
self.linedit.move(120,420)
self.linedit.resize(300,28)
layout.addWidget(self.button1)
layout.addWidget(self.linedit)
self.setLayout(layout)
self.button2= QPushButton("开始检测", self)
self.button2.move(20, 450)
self.button2.clicked.connect(self.detection)
self.button3 = QPushButton("退出", self)
self.button3.move(220, 450)
self.button3.clicked.connect(self.close)
self.button4 = QPushButton("返回", self)
self.button4.move(320, 450)
self.button4.clicked.connect(self.turn1)
self.button5=QPushButton("结束检测",self)
self.button5.move(120,450)
self.button5.clicked.connect(self.closese)
继续学习