# Install: # pip install transformers torch pillow duckduckgo-search from transformers import pipeline from PIL import Image from duckduckgo_search import DDGS print("😊 Starting FaceMatch AI...") # AI that describes images vision_ai = pipeline( "image-to-text", model="Salesforce/blip-image-captioning-base" ) def search_face_image(photo_path): print("\n😊 Hey! Let's look at your image.") try: image = Image.open(photo_path).convert("RGB") print("šŸ”Ž Analyzing the image...") description = vision_ai(image)[0]["generated_text"] print(f"🧠 Image details: {description}") print("🌐 Searching for related public webpages...") with DDGS() as search: results = list(search.text( description, max_results=10 )) if results: print("\n😊 Yay! I found some relevant search results!") for i, result in enumerate(results, 1): print(f"\nšŸ“„ Result {i}: {result['title']}") print(f"šŸ”— Link: {result['href']}") print(f"šŸ“ {result['body']}") else: print("šŸ™‚ No results this time. Let's try another image.") except Exception as error: print(f"šŸ˜• Something went wrong: {error}") if __name__ == "__main__": photo = input("šŸ“· Enter the path to your image: ") search_face_image(photo)