from services.classifier import classify_garment import requests import os def test_local_classifier(): print("Testing Local Classifier with Real Image...") # Download Jeans if not os.path.exists("temp_jeans.jpg"): img_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Jeans.jpg/440px-Jeans.jpg" with open("temp_jeans.jpg", "wb") as f: f.write(requests.get(img_url).content) # Classify cat, desc, tags = classify_garment("temp_jeans.jpg") print("\n--- RESULTS ---") print(f"Category: {cat}") print(f"Description: {desc}") print(f"Tags: {tags}") if cat == "bottom": print("✅ SUCCESS: Detected matching bottom") else: print("❌ FAILURE: Did not detect bottom") if __name__ == "__main__": test_local_classifier()