- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.2 KiB
Python
Executable File
40 lines
1.2 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Test du pipeline complet: CLIP + FAISS + OWL-v2"""
|
|
import sys
|
|
from pathlib import Path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
from core.embedding.clip_embedder import CLIPEmbedder
|
|
from core.embedding.faiss_manager import FAISSManager
|
|
from PIL import Image
|
|
|
|
print("="*70)
|
|
print(" TEST PIPELINE COMPLET")
|
|
print("="*70)
|
|
|
|
# 1. CLIP
|
|
print("\n1. CLIP Embeddings...")
|
|
clip = CLIPEmbedder()
|
|
img1 = Image.new('RGB', (224, 224), color=(255, 0, 0))
|
|
img2 = Image.new('RGB', (224, 224), color=(0, 255, 0))
|
|
emb1 = clip.embed_image(img1)
|
|
emb2 = clip.embed_image(img2)
|
|
print(f"✓ 2 embeddings générés")
|
|
|
|
# 2. FAISS
|
|
print("\n2. FAISS Indexation...")
|
|
faiss = FAISSManager(dimensions=512, metric="cosine")
|
|
faiss.add_embedding("red", emb1, {"color": "red"})
|
|
faiss.add_embedding("green", emb2, {"color": "green"})
|
|
print(f"✓ Index: {faiss.get_stats()['total_vectors']} vecteurs")
|
|
|
|
# 3. Recherche
|
|
print("\n3. Recherche de similarité...")
|
|
results = faiss.search_similar(emb1, k=2)
|
|
for i, r in enumerate(results, 1):
|
|
print(f" {i}. {r.metadata['color']}: {r.similarity:.4f}")
|
|
|
|
print("\n" + "="*70)
|
|
print("✅ PIPELINE COMPLET FONCTIONNEL")
|
|
print("="*70)
|