Skip to content

mubinui/put-it-on

Repository files navigation

Virtual Try-On App

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!

Features

  • 🎨 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

What This App Does

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

Two Apps Included

  1. app.py - Standard virtual try-on with AI analysis
  2. virtual_tryon_advanced.py - Advanced version with visual composites and enhanced features

Installation

  1. Clone or download this repository

  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up your Gemini API key:

    • Get your API key from Google AI Studio
    • Open the .env file and replace your_gemini_api_key_here with your actual API key:
      GEMINI_API_KEY=your_actual_api_key_here
      

Usage

  1. Start the basic application:

    streamlit run app.py

    Or start the advanced version:

    streamlit run virtual_tryon_advanced.py
  2. Open your browser and navigate to the URL shown in the terminal (usually http://localhost:8501)

  3. Upload your images:

    • Upload a clear photo of yourself
    • Upload a photo of the clothing item you want to try on
  4. Generate your virtual try-on by clicking the "Create Virtual Try-On" button

For Actual Virtual Try-On

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

Tips for Best Analysis

  • 📷 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

File Structure

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

Features & Validation

Image Validation

  • ✅ File size validation (max 10MB)
  • ✅ Image dimension validation (100x100 to 4000x4000 pixels)
  • ✅ Format validation (PNG, JPG, JPEG)
  • ✅ Image integrity checks

Error Handling

  • ✅ API key validation
  • ✅ Network error handling
  • ✅ Invalid image format handling
  • ✅ Processing timeout handling
  • ✅ User-friendly error messages

UI/UX Features

  • ✅ 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

Technology Stack

  • 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

Privacy & Security

  • 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

Troubleshooting

Common Issues:

  1. "API Key Required" error:

    • Make sure you've added your Gemini API key to the .env file
    • Verify the API key is valid and active
  2. 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
  3. Processing takes too long:

    • Try using smaller image files
    • Check your internet connection
    • Restart the application if needed

Contributing

Feel free to contribute to this project by:

  • Reporting bugs
  • Suggesting new features
  • Improving the UI/UX
  • Optimizing performance

License

This project is for educational and personal use. Please respect Google's Gemini AI usage policies and terms of service.

Acknowledgments

  • Google Gemini AI for the virtual try-on processing
  • Streamlit for the amazing web framework
  • The open-source community for inspiration and resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors