bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
"""
|
|
Test Real AI Pipeline
|
|
Verify YOLO and CLIP work correctly
|
|
"""
|
|
|
|
import sys
|
|
sys.path.insert(0, '/home/bernt/.openclaw/workspace/iom')
|
|
|
|
from ai_pipeline.real_ai import RealAIClassifier
|
|
from PIL import Image
|
|
import numpy as np
|
|
|
|
|
|
def test_real_ai():
|
|
"""Test real AI pipeline"""
|
|
print("=== Real AI Pipeline Test ===\n")
|
|
|
|
# Create test image
|
|
print("Creating test image...")
|
|
img = Image.new('RGB', (640, 480), color='red')
|
|
img.save('test_image.jpg')
|
|
|
|
# Initialize classifier
|
|
print("Initializing AI classifier...")
|
|
classifier = RealAIClassifier(use_real_ai=True)
|
|
|
|
print(f"Real AI available: {classifier.use_real_ai}")
|
|
print(f"Device: {classifier.device}")
|
|
print(f"YOLO loaded: {classifier.yolo_model is not None}")
|
|
print(f"CLIP loaded: {classifier.clip_model is not None}")
|
|
|
|
# Analyze image
|
|
print("\nAnalyzing image...")
|
|
result = classifier.analyze_image("test_image.jpg")
|
|
|
|
print(f"Detected objects: {len(result.detected_objects)}")
|
|
print(f"Scene type: {result.scene_type}")
|
|
print(f"Confidence: {result.confidence}")
|
|
print(f"Has embeddings: {result.embeddings is not None}")
|
|
|
|
if result.detected_objects:
|
|
print("\nDetected objects:")
|
|
for obj in result.detected_objects[:5]:
|
|
print(f" - {obj['label']}: {obj['confidence']:.2f}")
|
|
|
|
# Cleanup
|
|
import os
|
|
os.remove('test_image.jpg')
|
|
|
|
print("\n✅ Real AI test complete")
|
|
return result
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_real_ai()
|