YOLO GPU + AiOrchestratorTool unifié
Date: 08/02/2026
Status: TERMINE
Résumé
Migration de YOLO d'un container CPU standalone vers un outil intégré dans l'ai-orchestrator (GPU RTX 2070 Super). Refonte de l'interface frontend AiOrchestratorTool avec système de panels par outil.
Actions réalisées
Phase 1: Service YOLO sur win11
- Créé
I:\yolo-api\yolo_service.py - FastAPI + Ultralytics GPU
- Endpoint
/predict (multipart/form-data) pour detect/segment/pose/classify/obb
- Cache LRU des modèles (max 3)
- Utilise GPU 1 (RTX 2070 Super) via CUDA_VISIBLE_DEVICES=1
- Port 5402
- Créé
I:\yolo-api\start_yolo.bat
- Installé venv Python + dépendances (torch+cu128, ultralytics, fastapi, uvicorn)
- Vérifié CUDA fonctionnel sur les 2 GPUs
Phase 2: Intégration ai-orchestrator
- Ajouté YOLO dans TOOLS_CONFIG (port 5402, gpu_id=1, category=vision)
- Ajouté 5 schemas YOLO: detect, segment, pose, classify, obb
- Créé
execute_yolo_job() - upload image vers le service, parse résultat, sauvegarde visualization
- Ajouté routage dans le dispatcher
execute_job()
- Commit:
3eb4366 - pushé sur GitLab → CI/CD déploiement automatique
Phase 3: Refonte Frontend
- AiOrchestratorTool.tsx réécrit (390 lignes):
- Header dual GPU (RTX 3090 + RTX 2070S) avec barres VRAM
- Worker + Queue status
- Grille d'outils cliquable (masque ollama-gpu1)
- Panel dynamique par outil sélectionné
- Jobs history filtrable
- YoloPanel.tsx (350 lignes) - Panel YOLO dédié:
- Tabs tâches (Detect/Segment/Pose/Classify/OBB)
- Upload image (drag&drop, fichier, URL)
- Params modèle + confiance + avancé
- Canvas résultat avec visualization annotée
- Liste détections triées par confiance
- GenericPanel.tsx (210 lignes) - Panel fallback:
- Auto-génère formulaire depuis schemas API
- Types input adaptés (select, number, text, file, textarea, toggle)
- Submit job + polling résultat
- ai-panels/index.ts - Registry des panels custom
Phase 4: Nettoyage
- Supprimé YoloTool.tsx
- Retiré 'yolo' de TOOLS_ENABLED_CONNECTORS
- Retiré import YoloTool du routeur tools
- Commit:
1c5a7c6 - pushé sur GitLab → CI/CD déploiement automatique
Fichiers modifiés/créés
I:\yolo-api\yolo_service.py (nouveau, win11)
I:\yolo-api\start_yolo.bat (nouveau, win11)
ai-orchestrator/app/main.py (modifié, +176 lignes)
connectors-front/src/components/tools/AiOrchestratorTool.tsx (réécrit)
connectors-front/src/components/tools/ai-panels/YoloPanel.tsx (nouveau)
connectors-front/src/components/tools/ai-panels/GenericPanel.tsx (nouveau)
connectors-front/src/components/tools/ai-panels/index.ts (nouveau)
connectors-front/src/components/tools/index.ts (modifié)
connectors-front/src/routes/.../tools/index.tsx (modifié)
connectors-front/src/components/tools/YoloTool.tsx (supprimé)
Vérification
- [x] Tester YOLO service manuellement:
curl http://192.168.1.30:5402/health → OK, GPU RTX 2070 Super détecté
- [x] CI/CD connectors-front: pipeline 868 → success
- [x] CI/CD ai-orchestrator: pipeline 867 → failed (pre_deploy hook timeout SSH win11), retry → success
- [x] YOLO visible dans
/api/tools de l'orchestrator (id=yolo, category=vision, gpu_id=1)
- [x] YOLO service démarré manuellement sur win11 (python + uvicorn, port 5402)
- [x] Test end-to-end API: upload bus.jpg → job detect → 5 détections (1 bus 95.7%, 4 persons), 215ms GPU, 1097MB VRAM, visualization OK
Notes post-déploiement
- SSH vers win11 est très lent (~15s par connexion) - cause probable: reverse DNS lookup Windows OpenSSH
- Ceci cause des timeouts sur les endpoints
/api/tools/{id}/start|stop de l'orchestrator
- Le pre_deploy hook a échoué au premier essai (timeout 30s), réussi au retry (worker déjà en pause)
- ollama-gpu1 a été stoppé manuellement pour libérer GPU1 avant de lancer YOLO