Spaces:
Runtime error
Runtime error
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:
- Uses the try-on-diffusion API to generate a virtual try-on result.
- 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.pyif needed)
Usage
- Clone this repo and open in Hugging Face Spaces or run locally.
- Install requirements:
pip install -r requirements.txt - Run the app:
python app.py - 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
- All dependencies are listed in
requirements.txt. - The backend Flask server is started automatically by
app.py. - The Gradio interface is the entry point for Hugging Face Spaces.
Credits
- BLIP: Salesforce BLIP
- CLIP: OpenAI CLIP
- LLM: TinyLlama
- Try-On API: try-on-diffusion
License
MIT