-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhack-demo.py
30 lines (21 loc) · 923 Bytes
/
hack-demo.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
import tkinter as tk
from video_stream import VideoStreamHandler
from content_description import ContentDescriber
# Main GUI setup and button handlers
root = tk.Tk()
root.title("Webcam Stream")
user_input = tk.Entry(root, width=50)
user_input.pack()
canvas = tk.Canvas(root, width=640, height=480)
canvas.pack()
video_handler = VideoStreamHandler(root, canvas)
content_describer = ContentDescriber(root, user_input, video_handler)
button = tk.Button(root, text="Stop", width=50, command=video_handler.stop_video)
button.pack(anchor=tk.CENTER, expand=True)
describe_button = tk.Button(root, text="Adapt for FOCUS", width=50,
command=content_describer.threaded_describe_content)
describe_button.pack(anchor=tk.CENTER, expand=True)
message_label = tk.Label(root, textvariable=content_describer.message_var, wraplength=500)
message_label.pack()
video_handler.start_stream()
root.mainloop()