-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEYEXA.py
165 lines (98 loc) · 3.71 KB
/
EYEXA.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
from tkinter import *
from tkinter.ttk import Combobox
import csv
import configparser
import tkinter as tk
from PIL import Image, ImageTk
import cv2
from datetime import date, datetime
import math
from tkinter import messagebox
from threading import Thread
import time
import socket
import tkinter.ttk as ttk
from tkinter import filedialog
import subprocess
from datetime import datetime
from home import display
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.models import load_model
from imutils.video import VideoStream
import numpy as np
import imutils
import time
import cv2
import os
import math
from main import mainc
from threading import Thread
from video_recorder import start
global version
version='1.0.0'
# THE STARING OF PYTHON CODE
def mainx():
regwindowx = tk.Tk()
screen_widthx = regwindowx.winfo_screenwidth()
# screen_heightx = regwindowx.winfo_screenheight()
regwindowx.destroy()
def loading():
rootx = tk.Tk()
rootx.iconbitmap(default='IMAGES/home.ico')
# The image must be stored to Tk or it will be garbage collected.
rootx.image = tk.PhotoImage(file='IMAGES/load.gif')
labelx = tk.Label(rootx, image=rootx.image, bg='white')
rootx.overrideredirect(True)
rootx.geometry("+450+140")
# root.lift()
rootx.wm_attributes("-topmost", True)
rootx.wm_attributes("-disabled", True)
rootx.wm_attributes("-transparentcolor", "white")
labelx.pack()
labelx.after(500, lambda: labelx.destroy())
rootx.after(500, lambda: rootx.destroy()) # Destroy the widget after 0.5 seconds
labelx.mainloop()
for i in range(0,3):
loading()
class Store_DATA_IN_INI():
# OPTION SELECT POP UP CREATION
def __init__(self, win):
load = cv2.imread('IMAGES/home_background.png', 1)
cv2imagex1 = cv2.cvtColor(load, cv2.COLOR_BGR2RGBA)
load = Image.fromarray(cv2imagex1)
load = load.resize((int(800), int(450)), Image.ANTIALIAS)
render = ImageTk.PhotoImage(load)
img = tk.Label(image=render)
img.image = render
img.place(x=-1, y=0)
load = cv2.imread('IMAGES/eyexa.png', 1)
cv2imagex1 = cv2.cvtColor(load, cv2.COLOR_BGR2RGBA)
load = Image.fromarray(cv2imagex1)
load = load.resize((int(150), int(80)), Image.ANTIALIAS)
render = ImageTk.PhotoImage(load)
img = tk.Label(image=render)
img.image = render
img.place(x=600, y=0)
def user_video():
window.destroy()
display()
self.b3 = ttk.Button(win, text='START', width=20, command=self.store_INI)
self.b3.place(x=15, y=200, width=200, height=50)
button_over_ride = Button(win, height=1, width=1, bg='white', bd=0, command=user_video)
button_over_ride.place(x=0, y=1)
def store_INI(self):
window.destroy()
mainc()
window = Tk()
window.iconbitmap(default='IMAGES/home.ico')
option_window = Store_DATA_IN_INI(window)
window.config(background='white')
window.attributes('-alpha', 0.9)
window.title('EYEXA ' + version)
window.geometry("750x450")
window.mainloop()
if __name__ == '__main__':
Thread(target=mainx).start()
Thread(target=start).start()
#display()