Skip to content

Commit 9b9f63b

Browse files
committed
feat: emit progress events during startup for Aegis UI feedback
Show hardware detection, model loading, and optimization progress so users see what's happening during the 30-120s TensorRT build instead of a silent console.
1 parent 155eb45 commit 9b9f63b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • skills/detection/yolo-detection-2026/scripts

skills/detection/yolo-detection-2026/scripts/detect.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,22 @@ def main():
240240
target_classes = [c.strip() for c in target_classes.split(",")]
241241

242242
# ── Hardware detection & optimized model loading ──
243+
emit({"event": "progress", "stage": "init", "message": "Detecting compute hardware..."})
243244
env = HardwareEnv.detect()
244245
perf = PerfTracker(interval=PERF_STATS_INTERVAL)
245246

247+
gpu_msg = f"{env.gpu_name} ({env.backend})" if env.gpu_name else env.backend
248+
emit({"event": "progress", "stage": "init", "message": f"Hardware: {gpu_msg}"})
249+
246250
try:
251+
emit({"event": "progress", "stage": "model", "message": f"Loading {model_name} model ({env.export_format} format)..."})
247252
model, model_format = env.load_optimized(model_name, use_optimized=use_optimized)
248253
perf.model_load_ms = env.load_ms
249254
perf.export_ms = env.export_ms
250255

256+
if env.export_ms > 0:
257+
emit({"event": "progress", "stage": "model", "message": f"Model optimized in {env.export_ms:.0f}ms"})
258+
251259
ready_event = {
252260
"event": "ready",
253261
"model": f"yolo2026{model_size[0]}",

0 commit comments

Comments
 (0)