import cv2
import sys
import torch
from PySide6.QtGui import QImage

from PySide6.QtWidgets import QMainWindow, QApplication



def convert2QImage(img):
    height, width, channel = img.shape
    return QImage(img,width, height, width*channel, QImage.Format_RGB888)


class MainWindow(QMainWindow, ui_MainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.setupUi(self)
        
        
if __name__ =="__main__":
    app = QApplication(sys.argv)
    
    window = MainWindow
    window.show()
    
    app.exec()

pyside6 ui文件转成py文件:

pyside6-uic.exe ui_mainwindow.ui -o ui_mainwindow.py

Logo

一站式 AI 云服务平台

更多推荐