|
|
@ -12,7 +12,7 @@ class PoseEstimationGUI: |
|
|
self.mp4_file_path = None |
|
|
self.mp4_file_path = None |
|
|
self.root = tk.Tk() |
|
|
self.root = tk.Tk() |
|
|
self.root.title("Pose Estimation GUI") |
|
|
self.root.title("Pose Estimation GUI") |
|
|
self.root.geometry("400x250") |
|
|
self.root.geometry("400x400") |
|
|
self.root.config(bg="#F9F9F9") |
|
|
self.root.config(bg="#F9F9F9") |
|
|
|
|
|
|
|
|
self.camera_options = [] # Initialize camera options list |
|
|
self.camera_options = [] # Initialize camera options list |
|
|
@ -42,13 +42,21 @@ class PoseEstimationGUI: |
|
|
font=("Arial", 12, "bold"), command=self.start_pose_estimation) |
|
|
font=("Arial", 12, "bold"), command=self.start_pose_estimation) |
|
|
self.start_button.pack(pady=(20, 10)) |
|
|
self.start_button.pack(pady=(20, 10)) |
|
|
|
|
|
|
|
|
|
|
|
# Create a checkbox to enable/disable Export of Landmarks |
|
|
|
|
|
self.export_Landmarks = tk.BooleanVar() |
|
|
|
|
|
self.export_Landmarks.set(False) |
|
|
|
|
|
export_Landmarks_checkbox = tk.Checkbutton(self.root, text="Export Landmarks", variable=self.export_Landmarks, |
|
|
|
|
|
bg="#F9F9F9", |
|
|
|
|
|
font=("Arial", 12, "bold"), onvalue=True, offvalue=False) |
|
|
|
|
|
export_Landmarks_checkbox.pack() |
|
|
|
|
|
|
|
|
self.root.mainloop() |
|
|
self.root.mainloop() |
|
|
|
|
|
|
|
|
def start_pose_estimation(self): |
|
|
def start_pose_estimation(self): |
|
|
if self.mp4_file_path is not None: |
|
|
if self.mp4_file_path is not None: |
|
|
# Start pose estimation on the selected mp4 file |
|
|
# Start pose estimation on the selected mp4 file |
|
|
pose_estimator = HPEModule() |
|
|
pose_estimator = HPEModule() |
|
|
pose_thread_file = threading.Thread(target=pose_estimator.startHPEwithCamera, args=(self.mp4_file_path,)) |
|
|
pose_thread_file = threading.Thread(target=pose_estimator.startHPEwithCamera, args=(self.mp4_file_path, self.export_Landmarks,)) |
|
|
self.mp4_file_path = None |
|
|
self.mp4_file_path = None |
|
|
self.file_selected_label.config(text="No File selected", fg="red") |
|
|
self.file_selected_label.config(text="No File selected", fg="red") |
|
|
pose_thread_file.start() |
|
|
pose_thread_file.start() |
|
|
@ -57,7 +65,7 @@ class PoseEstimationGUI: |
|
|
# print(self.selected_camera.get()) |
|
|
# print(self.selected_camera.get()) |
|
|
pose_estimator = HPEModule() |
|
|
pose_estimator = HPEModule() |
|
|
camera = int(self.selected_camera.get()) |
|
|
camera = int(self.selected_camera.get()) |
|
|
pose_thread_camera = threading.Thread(target=pose_estimator.startHPEwithCamera, args=(camera,)) |
|
|
pose_thread_camera = threading.Thread(target=pose_estimator.startHPEwithCamera, args=(camera, self.export_Landmarks,)) |
|
|
pose_thread_camera.start() |
|
|
pose_thread_camera.start() |
|
|
|
|
|
|
|
|
def select_file(self): |
|
|
def select_file(self): |
|
|
|