-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathui.py
More file actions
48 lines (36 loc) · 998 Bytes
/
ui.py
File metadata and controls
48 lines (36 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 31 17:27:12 2019
@author: Lenovo
"""
import tkinter as tk
from tkinter.ttk import *
import subprocess
import sys
from threading import Thread
def run_script(script_name):
def target():
subprocess.call([sys.executable, script_name])
Thread(target=target).start()
def face():
run_script("face-try.py")
def blink():
run_script("blinkDetect.py")
def lane():
run_script("lanedetection.py")
# GUI setup
root = tk.Tk()
root.geometry('300x550')
root.title('Drowsiness Detection System')
style = Style()
style.configure('TButton', font=('calibri', 16, 'bold'), borderwidth='2', padding=10)
# Buttons
btn1 = Button(root, text='Face Detection', command=face)
btn1.pack(pady=40)
btn2 = Button(root, text='Blink Detection', command=blink)
btn2.pack(pady=20)
btn4 = Button(root, text='Lane Detection', command=lane)
btn4.pack(pady=30)
btn3 = Button(root, text='Quit', command=root.destroy)
btn3.pack(pady=30)
root.mainloop()