From 2431a6c9e91da59e86f863992082fc6d39f95762 Mon Sep 17 00:00:00 2001 From: Dom Date: Sat, 18 Apr 2026 19:52:20 +0200 Subject: [PATCH] =?UTF-8?q?fix(vision):=20dernier=20seuil=20distance=20har?= =?UTF-8?q?dcod=C3=A9=20(150px=E2=86=92500px)=20+=20nettoyage=20commentair?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MAX_TEMPLATE_DISTANCE dans zoned_template_match était encore à 150px. Tous les seuils de distance sont maintenant alignés à 500px : - MAX_DISTANCE_PX (CLIP) : 500 - MAX_GLOBAL_DISTANCE (template global) : 500 - MAX_SEECLICK_DISTANCE : 500 - MAX_TEMPLATE_DISTANCE (template zonée) : 500 Commentaires périmés corrigés (plus de références aux anciennes valeurs). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../backend/services/intelligent_executor.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/visual_workflow_builder/backend/services/intelligent_executor.py b/visual_workflow_builder/backend/services/intelligent_executor.py index 599e11268..27b1d9f09 100644 --- a/visual_workflow_builder/backend/services/intelligent_executor.py +++ b/visual_workflow_builder/backend/services/intelligent_executor.py @@ -219,9 +219,9 @@ class IntelligentExecutor: Combine le score sémantique avec la proximité à la position originale. SEUILS STRICTS pour éviter les faux positifs: - - MAX_DISTANCE_PX: Distance maximale absolue (80px) - - MIN_CLIP_SCORE: Score CLIP minimum (0.65) - - MIN_COMBINED_SCORE: Score combiné minimum (0.6) + - MAX_DISTANCE_PX: Distance maximale absolue (500px) + - MIN_CLIP_SCORE: Score CLIP minimum (0.50) + - MIN_COMBINED_SCORE: Score combiné minimum (0.45) """ # === SEUILS ÉQUILIBRÉS === # VWB workflows manuels : l'ancre peut être loin de la position d'origine @@ -615,7 +615,7 @@ def zoned_template_match( # === VÉRIFICATION DISTANCE MAXIMALE === # Rejeter tout match trop loin de la position originale - MAX_TEMPLATE_DISTANCE = 150 # Limite absolue en pixels + MAX_TEMPLATE_DISTANCE = 500 final_distance = math.sqrt((center_x - orig_center_x)**2 + (center_y - orig_center_y)**2) if final_distance > MAX_TEMPLATE_DISTANCE: @@ -704,8 +704,7 @@ def find_and_click( method='clip' ) - # clip_result.found est déjà conditionné par MIN_COMBINED_SCORE (0.6) - # et les seuils stricts (MAX_DISTANCE_PX=80, MIN_CLIP_SCORE=0.65) + # clip_result.found est conditionné par les seuils dans find_anchor_in_screen if clip_result.found: print(f"✅ [Vision] UI-DETR-1+CLIP réussi! Confiance: {clip_result.confidence:.2f}") return { @@ -717,8 +716,7 @@ def find_and_click( 'search_time_ms': (_time.time() - start_time) * 1000 } else: - # Seuils stricts: MAX_DISTANCE=80px, MIN_CLIP=0.65, MIN_COMBINED=0.6 - print(f"⚠️ [Vision] UI-DETR-1+CLIP: rejeté (confiance: {clip_result.confidence:.2f} < 0.6 ou distance > 80px)") + print(f"⚠️ [Vision] UI-DETR-1+CLIP: rejeté (confiance: {clip_result.confidence:.2f})") except Exception as clip_err: print(f"⚠️ [Vision] Erreur UI-DETR-1+CLIP: {clip_err}") import traceback