You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
import tkinter as tk
|
|
from DataStreamModule import DataStreamModule
|
|
from HPEModule import HPEModule
|
|
import threading
|
|
|
|
|
|
class PoseEstimationGUI:
|
|
|
|
def __init__(self):
|
|
self.root = tk.Tk()
|
|
self.root.title("Pose Estimation GUI")
|
|
|
|
self.camera_options = [] # Initialize camera options list
|
|
|
|
# Create a drop-down menu with available cameras
|
|
self.camera_options = DataStreamModule().findCameras()
|
|
self.selected_camera = tk.StringVar()
|
|
self.selected_camera.set(self.camera_options[0]) # default value
|
|
camera_menu = tk.OptionMenu(self.root, self.selected_camera, *self.camera_options)
|
|
camera_menu.pack()
|
|
|
|
# Create a button to start pose estimation
|
|
self.start_button = tk.Button(self.root, text="Start Pose Estimation", command=self.start_pose_estimation)
|
|
self.start_button.pack()
|
|
|
|
self.root.mainloop()
|
|
|
|
def start_pose_estimation(self):
|
|
# Start pose estimation on the selected camera
|
|
# print(self.selected_camera.get())
|
|
pose_estimator = HPEModule()
|
|
camera = int(self.selected_camera.get())
|
|
pose_thread = threading.Thread(target=pose_estimator.startHPEwithCamera, args=(camera,))
|
|
pose_thread.start()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
PoseEstimationGUI()
|
|
|