perf: seuil CLIP 0.45→0.20 + cache singleton IntelligentExecutor
Some checks failed
security-audit / Bandit (scan statique) (push) Successful in 13s
security-audit / pip-audit (CVE dépendances) (push) Successful in 11s
security-audit / Scan secrets (grep) (push) Successful in 8s
tests / Lint (ruff + black) (push) Successful in 15s
tests / Tests unitaires (sans GPU) (push) Failing after 15s
tests / Tests sécurité (critique) (push) Has been skipped
Some checks failed
security-audit / Bandit (scan statique) (push) Successful in 13s
security-audit / pip-audit (CVE dépendances) (push) Successful in 11s
security-audit / Scan secrets (grep) (push) Successful in 8s
tests / Lint (ruff + black) (push) Successful in 15s
tests / Tests unitaires (sans GPU) (push) Failing after 15s
tests / Tests sécurité (critique) (push) Has been skipped
Seuil CLIP abaissé pour les icônes génériques (dossier, fichier) qui obtenaient 0.25 au lieu de 0.45. IntelligentExecutor en singleton — CLIP et RF-DETR chargés une seule fois et réutilisés entre les étapes. Élimine le rechargement de ~40s par étape. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -227,8 +227,8 @@ class IntelligentExecutor:
|
|||||||
# VWB workflows manuels : l'ancre peut être loin de la position d'origine
|
# VWB workflows manuels : l'ancre peut être loin de la position d'origine
|
||||||
# (résolution différente, écran différent, fenêtre déplacée)
|
# (résolution différente, écran différent, fenêtre déplacée)
|
||||||
MAX_DISTANCE_PX = 500 # Tolérance large pour VWB cross-résolution
|
MAX_DISTANCE_PX = 500 # Tolérance large pour VWB cross-résolution
|
||||||
MIN_CLIP_SCORE = 0.50 # Score CLIP minimum (0.50 = ressemblance basique)
|
MIN_CLIP_SCORE = 0.40 # Score CLIP minimum (baissé pour icônes génériques)
|
||||||
MIN_COMBINED_SCORE = 0.45 # Score combiné minimum pour accepter un match
|
MIN_COMBINED_SCORE = 0.20 # Score combiné minimum (baissé pour cross-résolution)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Essayer d'importer et utiliser CLIP
|
# Essayer d'importer et utiliser CLIP
|
||||||
@@ -652,6 +652,17 @@ def zoned_template_match(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_cached_executor: Optional['IntelligentExecutor'] = None
|
||||||
|
|
||||||
|
|
||||||
|
def _get_executor(detection_threshold: float = 0.35) -> 'IntelligentExecutor':
|
||||||
|
"""Singleton IntelligentExecutor — modèles chargés une seule fois."""
|
||||||
|
global _cached_executor
|
||||||
|
if _cached_executor is None:
|
||||||
|
_cached_executor = IntelligentExecutor(detection_threshold=detection_threshold)
|
||||||
|
return _cached_executor
|
||||||
|
|
||||||
|
|
||||||
def find_and_click(
|
def find_and_click(
|
||||||
anchor_image_base64: str,
|
anchor_image_base64: str,
|
||||||
anchor_bbox: Optional[Dict[str, int]] = None,
|
anchor_bbox: Optional[Dict[str, int]] = None,
|
||||||
@@ -703,7 +714,7 @@ def find_and_click(
|
|||||||
if method == 'clip':
|
if method == 'clip':
|
||||||
print("🧠 [Vision] Essai UI-DETR-1 + CLIP (matching sémantique)...")
|
print("🧠 [Vision] Essai UI-DETR-1 + CLIP (matching sémantique)...")
|
||||||
try:
|
try:
|
||||||
executor = IntelligentExecutor(detection_threshold=detection_threshold)
|
executor = _get_executor(detection_threshold)
|
||||||
clip_result = executor.find_anchor_in_screen(
|
clip_result = executor.find_anchor_in_screen(
|
||||||
screen_image=screen_image,
|
screen_image=screen_image,
|
||||||
anchor_image=anchor_image,
|
anchor_image=anchor_image,
|
||||||
|
|||||||
Reference in New Issue
Block a user