-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhomeapp.py
54 lines (46 loc) · 1.63 KB
/
homeapp.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
"GUI home"
from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
from train import *
from test import *
import os
root = Tk()
root.title("Speaker Recognition")
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
root.geometry("%dx%d" % (width, height))
root.state('zoomed')
## Function for resizing the Image
def resize_image(event):
new_width = event.width
new_height = event.height
image = copy_of_image.resize((new_width, new_height))
photo = ImageTk.PhotoImage(image)
label.config(image = photo)
label.image = photo
## Resizable Image
image = Image.open(r'image/home.gif')
global copy_of_image
copy_of_image = image.copy()
photo = ImageTk.PhotoImage(image)
label = Label(root, image=photo)
label.place(x=0, y=0, relwidth=1, relheight=1)
label.bind('<Configure>', resize_image)
## Function
def training():
Training_file()
pass
def testing():
Testing_file()
## Adding Buttons
train_button = Button(root, fg="white", background="green", activebackground="green",
font=("Helvetica",20,'bold italic'), text='Training', padx=10, pady=10, command = training)
train_button.place(relx=0.35, rely=0.1, anchor=CENTER)
test_button = Button(root, fg="white", background="green", activebackground="green",
font=("Helvetica",20,'bold italic'), text='Testing', padx=10, pady=10, command = testing)
test_button.place(relx=0.7, rely=0.1, anchor=CENTER)
quit = Button(root, fg="white", background="green", activebackground="green",
font=("Helvetica",20,'bold italic'), text="Quit", command=root.destroy, padx=10, pady=10)
quit.place(relx=0.52, rely=0.89, anchor=CENTER)
root.mainloop()