Beispiel #1
0
    def run(self):
        print("starting", flush=True)
        print("bueno")
        model = TFModel(resource_path("output_graph.pb"), resource_path("output_labels.txt"), "Placeholder",
                        "final_result")
        print("model loaded")
        # self.label_load.setText("Loading: Model")
        count = 0
        available = []
        while True:
            test = VideoCapture(count)
            if test is None or not test.isOpened():
                break
            available.append(count)
            count += 1
        print(count)
        if count > 0:
            vid = VideoCapture(0)
            _, frame = vid.read()

            load = rt.Recoginize(model)
            load.daemon = True
            load.start()
            load.predict(frame)
            from time import sleep
            sleep(1)
            load.predict("kill")
            load.join()
            vid.release()
            print("model loaded")
            # self.label_load.setText("Loaded Model")
        print("donezo")
        # self.label_load.setText("Finalizing")
        self.progress.emit(model, len(available))
Beispiel #2
0
 def __init__(self, mainWindow):
     super().__init__()
     if getattr(sys, 'frozen', False):
         ui = resource_path('webcam_disconnected.ui')
     else:
         ui = 'Modules/UserInterface/webcam_disconnected.ui'
     loadUi(ui, self)
     self.okButton.clicked.connect(self.closePrompt)
     self.mainWindow = mainWindow
     self.ans = False
 def __init__(self, mainWindow):
     super().__init__()
     if getattr(sys, 'frozen', False):
         ui = resource_path('firsttime_prompt.ui')
     else:
         ui = 'Modules/UserInterface/firsttime_prompt.ui'
     loadUi(ui, self)
     self.noButton.clicked.connect(self.closeAction)
     self.yesButton.clicked.connect(self.start_tutorial)
     self.mainWindow = mainWindow
 def __init__(self, mainWindow):
     super().__init__()
     if getattr(sys, 'frozen', False):
         ui = resource_path('quit_prompt.ui')
     else:
         ui = 'Modules/UserInterface/quit_prompt.ui'
     loadUi(ui, self)
     self.quitYesButton.clicked.connect(self.logoutAction)
     self.quitNoButton.clicked.connect(self.closePrompt)
     self.mainWindow = mainWindow
     self.ans = False
Beispiel #5
0
 def __init__(self, mainWindow):
     super().__init__()
     if getattr(sys, 'frozen', False):
         ui = resource_path('firsttime_guide.ui')
     else:
         ui = 'Modules/UserInterface/firsttime_guide.ui'
     loadUi(ui, self)
     self.step_count = 0
     self.nextButton.clicked.connect(self.nextAction)
     self.previousButton.clicked.connect(self.prevAction)
     self.mainWindow = mainWindow
     self.mainWindow.firsttime_tutorial(0)
     self.tutorial_steps.setCurrentIndex(0)
Beispiel #6
0
 def __init__(self):
     print("start splash")
     super().__init__()
     if getattr(sys, 'frozen', False):
         ui = 'login_Form.ui'
         loadUi(resource_path(ui), self)
         movie = QMovie(resource_path("loading.gif"))
     else:
         ui = 'Modules/UserInterface/login_Form.ui'
         loadUi(ui, self)
         movie = QMovie("Modules/UserInterface/loading.gif")
     self.setFixedSize(340, 450)
     self.logoIMG.setMovie(movie)
     movie.start()
     self.update_loading("Loading: Graphical User Interface")
     print("loading main form")
     self.task = Loading(self.labelLoad)
     self.task.progress.connect(self.setMainForm)
     self.task.finished.connect(self.openMainForm)
     self.task.start()
     self.setWindowFlags(Qt.Window | Qt.FramelessWindowHint)
     self.show()
    def __init__(self, model, cameraCount):
        print("mf")
        super().__init__()
        if getattr(sys, 'frozen', False):
            ui = 'main_window.ui'
            loadUi(resource_path(ui), self)
            self.j_gesture = QMovie(resource_path("Icons/alphabet/J.gif"))
            self.z_gesture = QMovie(resource_path("Icons/alphabet/Z.gif"))
        else:
            ui = 'Modules/UserInterface/main_window.ui'
            loadUi(ui, self)
            self.j_gesture = QMovie(
                "Modules/UserInterface/Icons/alphabet/J.gif")
            self.z_gesture = QMovie(
                "Modules/UserInterface/Icons/alphabet/Z.gif")
        self.tab_history = [0]
        self.stackedWidget.setCurrentIndex(0)
        self.jLabel.setMovie(self.j_gesture)
        self.zLabel.setMovie(self.z_gesture)
        self.logoutButton.clicked.connect(self.logoutAction)
        self.homeButton.clicked.connect(self.showHomePage)
        self.helpButton.clicked.connect(self.showHelp)
        self.aboutButton.clicked.connect(self.showAbout)
        self.quitButton.clicked.connect(self.logoutAction)
        self.hideButton.clicked.connect(self.showMinimized)
        self.minmaxButton.clicked.connect(self.minmaxWindow)
        self.backButton_1.clicked.connect(self.backFunction)
        self.backButton_2.clicked.connect(self.backFunction)
        self.backButton_3.clicked.connect(self.backFunction)
        self.backButton_4.clicked.connect(self.backFunction)
        self.aslButton.clicked.connect(self.showASL)
        self.A_button.clicked.connect(lambda: self.showLetters(0))
        self.B_button.clicked.connect(lambda: self.showLetters(1))
        self.C_button.clicked.connect(lambda: self.showLetters(2))
        self.D_button.clicked.connect(lambda: self.showLetters(3))
        self.E_button.clicked.connect(lambda: self.showLetters(4))
        self.F_button.clicked.connect(lambda: self.showLetters(5))
        self.G_button.clicked.connect(lambda: self.showLetters(6))
        self.H_button.clicked.connect(lambda: self.showLetters(7))
        self.I_button.clicked.connect(lambda: self.showLetters(8))
        self.J_button.clicked.connect(lambda: self.showLetters(9))
        self.K_button.clicked.connect(lambda: self.showLetters(10))
        self.L_button.clicked.connect(lambda: self.showLetters(11))
        self.M_button.clicked.connect(lambda: self.showLetters(12))
        self.N_button.clicked.connect(lambda: self.showLetters(13))
        self.O_button.clicked.connect(lambda: self.showLetters(14))
        self.P_button.clicked.connect(lambda: self.showLetters(15))
        self.Q_button.clicked.connect(lambda: self.showLetters(16))
        self.R_button.clicked.connect(lambda: self.showLetters(17))
        self.S_button.clicked.connect(lambda: self.showLetters(18))
        self.T_button.clicked.connect(lambda: self.showLetters(19))
        self.U_button.clicked.connect(lambda: self.showLetters(20))
        self.V_button.clicked.connect(lambda: self.showLetters(21))
        self.W_button.clicked.connect(lambda: self.showLetters(22))
        self.X_button.clicked.connect(lambda: self.showLetters(23))
        self.Y_button.clicked.connect(lambda: self.showLetters(24))
        self.Z_button.clicked.connect(lambda: self.showLetters(25))
        self.thread = Thread(model)
        self.thread.changePixmap.connect(self.setImage)
        self.formWordCheckbox.stateChanged.connect(self.checkCheckBoxes)
        self.showAccuracyCheckbox.stateChanged.connect(self.checkCheckBoxes)

        self.wordBuilder = wb.WordBuilder()
        self.model = model
        self.showAcc = False
        self.showWord = False
        self.cameraCount = cameraCount
        self.cameraDevice = 0

        self.originial_buttons = self.aslButton.styleSheet()
        self.originial_home = self.homePage.styleSheet()
        self.original_label = self.letterFrame.styleSheet()
        self.original_video = self.videoLabel.styleSheet()
        self.original_checkbox = self.formWordCheckbox.styleSheet()
        self.original_layout = self.handToBeUsedLayout.styleSheet()
        self.tutorial_stylesheet = "border: 2px solid red;"

        self.createThread()
        self.center(self)