ai-virtual-tryon / README.md
selinazarzour's picture
Added the shopping automation logic in a new tab
dadf8b4
|
raw
history blame
3.7 kB
metadata
title: Ai Virtual Tryon
emoji: ๐ŸŒ
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.42.0
app_file: app.py
pinned: false

AI Virtual Try-On & Fashion Advisor (Hugging Face Space)

A portfolio-ready, full-stack AI fashion assistant and virtual try-on system. Combines computer vision, conversational AI, and web automation to deliver style advice, outfit analysis, and shopping recommendationsโ€”all in one interactive web app.

Features

1. Try-On & Analysis

  • Upload Clothing Image & Avatar Image:
    • Upload two images: one of a clothing item and one of an avatar/person.
  • AI Try-On Generation:
  • BLIP/CLIP AI Analysis:
    • Automatically analyzes the generated try-on image using BLIP for captioning and fashion prompts.
  • LLM Fashion Advice:
    • Provides detailed, context-aware fashion advice using TinyLlama LLM, based on the AI analysis.
  • All results (image, analysis, advice) are displayed together.

2. Chatbot (TinyLlama LLM)

  • Fashion Chatbot:
    • Chat with an AI stylist powered by TinyLlama.
    • The chatbot always has context from your latest try-on and analysis, so you can ask about "this outfit" or "these colors" and get relevant answers.

3. Find Similar

  • Upload any try-on or fashion image.
  • Get recommendations for similar outfits, complementary accessories, and alternative colors.
  • Suggested stores are included in the recommendations.

๐Ÿš€ Features

  • Virtual Try-On: Upload clothing and avatar images to generate realistic try-on results.
  • AI Fashion Analysis: Get style advice and outfit analysis using BLIP and CLIP models.
  • Conversational Assistant: Chat with a TinyLlama-powered AI for personalized fashion tips.
  • Automated Shopping: Find similar items and compare prices across e-commerce sites using Playwright automation.
  • Modern UI: Gradio-powered web interface for easy interaction.

๐Ÿ—๏ธ Architecture

  • Frontend: Gradio (for Hugging Face Spaces)
  • Backend: Flask API server (runs in background)
  • AI Models: BLIP, CLIP, TinyLlama (all open-source, loaded on demand)
  • Automation: Playwright for web scraping and product search

How It Works

  • All AI models (BLIP, CLIP, TinyLlama) are loaded and run in the backend.
  • The try-on image is generated via an external API (RapidAPI key required).
  • The app is organized into tabs for a clean, modern user experience.

Requirements

  • Python 3.8+
  • gradio, transformers, torch, Pillow, requests
  • A valid RapidAPI key for try-on-diffusion (replace in app.py if needed)

Usage

  1. Clone this repo and open in Hugging Face Spaces or run locally.
  2. Install requirements:
    pip install -r requirements.txt
    
  3. Run the app:
    python app.py
    
  4. Use the web UI:
    • Try-On & Analysis: Upload images, generate try-on, get analysis/advice.
    • Chatbot: Ask fashion questions with context.
    • Find Similar: Get recommendations for similar outfits.

๐Ÿ› ๏ธ Setup & Deployment

  1. All dependencies are listed in requirements.txt.
  2. The backend Flask server is started automatically by app.py.
  3. The Gradio interface is the entry point for Hugging Face Spaces.

Credits

License

MIT