|
|
|
|
|
""" |
|
|
Simple test of GUI without full validation. |
|
|
""" |
|
|
|
|
|
import sys |
|
|
import time |
|
|
from pathlib import Path |
|
|
import numpy as np |
|
|
|
|
|
project_root = Path(__file__).parent.parent |
|
|
sys.path.insert(0, str(project_root)) |
|
|
|
|
|
from ylff.utils.visualization_gui import create_gui |
|
|
|
|
|
|
|
|
def test_gui(): |
|
|
"""Test GUI with dummy data.""" |
|
|
gui = create_gui() |
|
|
|
|
|
|
|
|
def update_thread(): |
|
|
time.sleep(1) |
|
|
gui.add_status_message("Starting test...") |
|
|
|
|
|
|
|
|
for i in range(5): |
|
|
time.sleep(0.5) |
|
|
|
|
|
pose = np.eye(4) |
|
|
pose[:3, 3] = [i * 0.1, 0, 0] |
|
|
gui.add_frame_data(frame_idx=i, arkit_pose=pose) |
|
|
gui.add_progress_update(i + 1, 5) |
|
|
gui.add_status_message(f"Processing frame {i + 1}/5...") |
|
|
|
|
|
|
|
|
for i in range(5): |
|
|
time.sleep(0.3) |
|
|
pose = np.eye(4) |
|
|
pose[:3, 3] = [i * 0.1 + 0.05, 0.02, 0.01] |
|
|
gui.add_frame_data(frame_idx=i, da3_pose=pose) |
|
|
gui.add_status_message(f"DA3 inference: frame {i + 1}/5...") |
|
|
|
|
|
|
|
|
for i in range(5): |
|
|
time.sleep(0.2) |
|
|
errors = { |
|
|
"da3_vs_arkit_rot": 2.5 + i * 0.1, |
|
|
"da3_vs_arkit_trans": 0.01 + i * 0.001, |
|
|
} |
|
|
gui.add_frame_data(frame_idx=i, errors=errors) |
|
|
|
|
|
gui.add_status_message("Test complete!") |
|
|
gui.update_status("Complete", is_processing=False) |
|
|
|
|
|
import threading |
|
|
|
|
|
thread = threading.Thread(target=update_thread, daemon=True) |
|
|
thread.start() |
|
|
|
|
|
|
|
|
gui.run() |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
test_gui() |
|
|
|