-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
60 lines (47 loc) · 1.82 KB
/
main.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
from tkinter import *
# Import the tests
import animation, imageWorker, reading, face, analysisLauncher
import numpy as np
import os
# Instantiate the tkinter master object
root = Tk()
#=================================
# Opens the image configuration program
def viewImages():
imageWorker.main()
#==================================
# Runs the tests in a new fullscreen window
def startAnimation():
animation.main()
def startReading():
images = [] # Store images corresponding to the correct test
for readingImagePath in os.listdir('images'):
if 'reading' in readingImagePath and ('.jpg' in readingImagePath or '.png' in readingImagePath):
images.append('images/'+readingImagePath)
faceImagePath = np.random.choice(images)
reading.main(readingImagePath)
def startFace():
images = [] # Store images corresponding to the correct test
for faceImagePath in os.listdir('images'):
if 'face' in faceImagePath and ('.jpg' in faceImagePath or '.png' in readingImagePath):
images.append('images/'+readingImagePath)
faceImagePath = np.random.choice(images)
face.main(faceImagePath)
def startAnalysis():
analysisLauncher.loadLists()
def startup():
global root
#====================================================
# Add buttons to perform each task
animationButton = Button(root, text='Animation', command = startAnimation)
readingButton = Button(root, text='Reading', command = startReading)
imageButton = Button(root, text='View Images', command = viewImages)
faceButton = Button(root, text='Face Test', command = startFace)
analyzeButon = Button(root, text='Perform Analysis',command = startAnalysis)
animationButton.pack()
readingButton.pack()
imageButton.pack()
analyzeButon.pack()
faceButton.pack()
mainloop()
startup()