-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
109 lines (88 loc) · 1.86 KB
/
gui.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
import tkinter as tk
from tkinter import filedialog as fd
from PIL import Image, ImageTk
from tkinter import font
import hog
def select_file(event):
path = fd.askopenfilename()
hog.pedestrian_detection_video(path)
#restart()
global window
window = tk.Tk()
window.title = 'Open File'
window.geometry("800x400")
window.configure(
# bg = '#302F2F' # Dark Gray
bg = 'white'
)
window.resizable(False, False)
## LABELS
# Making our font tuples
lbl_Title_font = font.Font(
family = "Tisa",
size = 20,
weight = "bold",
slant = "italic"
)
btn_select_image_font = font.Font(
family = "Tisa",
size = 15,
weight = "bold"
)
lbl_Title = tk.Label(
text = 'Pedestrian Detector',
fg = 'black',
# bg = '#302F2F',
bg = 'white',
master = window,
)
lbl_Title.configure(font = lbl_Title_font) # using the font tuple here
# Image using Pillow (PIL)
#image - 1
load1 = Image.open("stick.jpg")
load1 = load1.resize((150, 150), Image.ANTIALIAS)
load1 = ImageTk.PhotoImage(load1)
lbl_image1_py = tk.Label(
image = load1,
bg = '#302F2F',
bd = 0
)
#image -2
load2 = Image.open("stick.jpg")
load2 = load2.transpose(Image.FLIP_LEFT_RIGHT)
load2 = load2.resize((150, 150), Image.ANTIALIAS)
load2 = ImageTk.PhotoImage(load2)
lbl_image2_py = tk.Label(
image = load2,
bg = '#302F2F',
bd = 0
)
## Button
btn_select_image = tk.Button(
text = 'Select Media',
bd = 4,
bg = '#302F2F',
fg = 'white',
#command = fd.askopenfilename()
highlightcolor = 'black'
)
btn_select_image.bind("<Button-1>",select_file)
btn_select_image.configure(font = btn_select_image_font)
#placing inside window here onwards
lbl_Title.place(
x = 240,
y = 40
)
lbl_image1_py.place(
x = 0,
y = 20
)
lbl_image2_py.place(
x = 650,
y = 20
)
btn_select_image.place(
y = 250,
x = 295
)
window.mainloop()