visual-narrator-llm / benchmarking /test_quality_fix.py
Ytgetahun's picture
feat: Visual Narrator 3B - Clean repository with professional benchmarks
d6e97b5
import requests
import json
import time
def test_quality_fixed_api():
"""Test the new quality-fixed API"""
test_scenes = [
"A car driving through a city at night with neon lights",
"A person dancing in a room with colorful lighting effects",
"A mountain landscape with sunset and trees"
]
print("🧪 TESTING QUALITY-FIXED API OUTPUTS...")
print("=" * 60)
for scene in test_scenes:
try:
response = requests.post(
"http://localhost:8003/describe/scene",
json={
"scene_description": scene,
"enhance_adjectives": True,
"adjective_density": 0.6,
"grammar_constraint": True
},
timeout=10
)
if response.status_code == 200:
result = response.json()
print(f"🎯 INPUT: {scene}")
print(f"🎨 OUTPUT: {result['enhanced_description']}")
print(f"⏱️ TIME: {result['processing_time']:.2f}ms")
print("─" * 50)
else:
print(f"❌ Failed for: {scene}")
except Exception as e:
print(f"💥 Error: {e}")
if __name__ == "__main__":
test_quality_fixed_api()