A powerful AI-powered virtual try-on application built with Streamlit and Google's Gemini AI, featuring a stunning liquid glass design. Get realistic virtual try-on experiences with advanced AI analysis!
- 🎨 Liquid Glass UI Design - Beautiful, modern glassmorphism interface
- 🤖 AI-Powered Virtual Try-On - Uses Google's latest Gemini models for intelligent analysis
- 👗 Smart Clothing Analysis - Advanced assessment of fit, style, and compatibility
- 🌈 Visual Composite Generation - Creates basic virtual try-on composites
- 📱 Responsive Design - Works on desktop, tablet, and mobile devices
- 🔒 Privacy Focused - Images are processed securely and not stored
- ✨ Real-time Processing - Fast and efficient virtual try-on generation
- 🎯 Smart Validation - Comprehensive image validation and error handling
This app provides AI-powered virtual try-on with both analysis and visual results:
✅ Virtual Try-On Analysis - Detailed AI assessment using Gemini 2.0 Flash
✅ Visual Composites - Basic image processing to show clothing on you
✅ Body Type Analysis - Understanding your proportions and best fits
✅ Clothing Assessment - Analysis of style, color, and fit compatibility
✅ Styling Recommendations - Expert advice on how to wear items
✅ Technical Implementation Guide - For developers wanting to improve the system
✅ Multiple Processing Options - Choose between basic analysis or advanced processing
app.py- Standard virtual try-on with AI analysisvirtual_tryon_advanced.py- Advanced version with visual composites and enhanced features
-
Clone or download this repository
-
Install dependencies:
pip install -r requirements.txt
-
Set up your Gemini API key:
- Get your API key from Google AI Studio
- Open the
.envfile and replaceyour_gemini_api_key_herewith your actual API key:GEMINI_API_KEY=your_actual_api_key_here
-
Start the basic application:
streamlit run app.py
Or start the advanced version:
streamlit run virtual_tryon_advanced.py
-
Open your browser and navigate to the URL shown in the terminal (usually
http://localhost:8501) -
Upload your images:
- Upload a clear photo of yourself
- Upload a photo of the clothing item you want to try on
-
Generate your virtual try-on by clicking the "Create Virtual Try-On" button
If you want to see actual virtual try-on images (not just styling advice), consider these specialized services:
- DressX - High-quality virtual try-on for fashion
- Zeekit (by Walmart) - Virtual fitting room technology
- Sephora Virtual Artist - For makeup and beauty products
- True Fit - Size and fit recommendations
- 📷 Use well-lit, high-quality photos
- 🧍 Stand straight and face the camera in your photo
- 👕 Choose clothing images with clear visibility
- 🎯 Avoid busy backgrounds
- 📏 Ensure good image resolution (minimum 100x100px, maximum 4000x4000px)
- 💾 Keep image files under 10MB
virtual-try-on-app/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .env # Environment variables (API key)
├── README.md # This file
└── .gitignore # Git ignore rules
- ✅ File size validation (max 10MB)
- ✅ Image dimension validation (100x100 to 4000x4000 pixels)
- ✅ Format validation (PNG, JPG, JPEG)
- ✅ Image integrity checks
- ✅ API key validation
- ✅ Network error handling
- ✅ Invalid image format handling
- ✅ Processing timeout handling
- ✅ User-friendly error messages
- ✅ Liquid glass design with glassmorphism effects
- ✅ Responsive layout for all screen sizes
- ✅ Progressive loading with progress bars
- ✅ Hover effects and smooth animations
- ✅ Clear instructions and tips
- ✅ Privacy and security information
- Frontend: Streamlit with custom CSS
- AI Backend: Google Gemini AI
- Image Processing: PIL (Python Imaging Library)
- Environment Management: python-dotenv
- Design: Custom glassmorphism CSS with gradient backgrounds
- Images are processed through Google's Gemini AI service
- No images are permanently stored by this application
- API communications are encrypted
- Follow Google's AI usage policies
-
"API Key Required" error:
- Make sure you've added your Gemini API key to the
.envfile - Verify the API key is valid and active
- Make sure you've added your Gemini API key to the
-
Image upload issues:
- Check image file size (must be under 10MB)
- Ensure image format is PNG, JPG, or JPEG
- Verify image dimensions are within acceptable range
-
Processing takes too long:
- Try using smaller image files
- Check your internet connection
- Restart the application if needed
Feel free to contribute to this project by:
- Reporting bugs
- Suggesting new features
- Improving the UI/UX
- Optimizing performance
This project is for educational and personal use. Please respect Google's Gemini AI usage policies and terms of service.
- Google Gemini AI for the virtual try-on processing
- Streamlit for the amazing web framework
- The open-source community for inspiration and resources