This project is an AI-driven virtual try-on system that enables users to visualize how different garments look on them without physically trying them on. Using a combination of object detection, body pose estimation, and image overlay, this project provides a realistic virtual fitting experience that can be integrated with e-commerce platforms for online shopping.
Real-time virtual try-on for various garments 🧥👗 Body pose estimation using MediaPipe for accurate garment alignment 🧍♂️💃 Personalized fit recommendations based on user body measurements 📏👕 Distance estimation and size adjustments for realistic garment overlay 📐📸 Integration with e-commerce platforms for easy purchasing options 🛒💳 Prerequisites 📋💻 Before running the project, make sure you have the following installed:
##Required Packages: Install the necessary Python packages by running the following command:
bash Copy code pip install numpy opencv-python mediapipe flask torch torchvision How to Run 🏃♂️💻 Step 1: Clone or Download the Project 📁📥 Download or clone the project repository to your local machine:
bash Copy code git clone https://github.com/your-username/AI-Virtual-Try-On Navigate to the project directory:
bash Copy code cd AI-Virtual-Try-On Step 2: Set Up the Model Files 📂🔗 This project requires several pre-trained models to run various features:
SMPL-X Model: For accurate 3D body modeling. Pix2Pix (cGAN) Model: For garment overlay simulation. Fully Connected Neural Network (FCNN): For personalized fit recommendations. Ensure these files are stored in the models/ directory as specified in the project structure.
Step 3: Running the Application 🖥️🚀 To start the virtual try-on system, run the following command:
bash Copy code python app.py Navigate to http://127.0.0.1:5000 in your web browser to access the application.
--model: Path to the trained garment overlay model. --prototxt: Path to the Caffe deploy prototxt file (for object detection). --confidence: Minimum probability to filter weak detections (default is 0.5).
Webcam Access: If enabled, the app can use your webcam to capture real-time images. Image Uploads: Upload images of both the user (model) and the garment to be tried on.
Click "Try On" to start the virtual try-on. Press q to quit the application if using live detection.
Pix2Pix (cGAN) for garment overlay simulation 👗📦 MediaPipe Pose for human pose estimation 🧍♀️🤸♂️ SMPL-X Model for realistic 3D body modeling 📏🧑🎤 OpenCV for image processing 📷🖼️ Flask for web application framework 🌐🖥️ PyTorch for machine learning tasks 🔥💻
Garment Overlay Simulation: Uses Pix2Pix (cGAN) to overlay garments onto the user's model image. Pose Estimation: MediaPipe Pose identifies key body landmarks for accurate garment alignment. Size Recommendation: Recommends the most suitable garment size based on user body measurements. Real-Time Processing: Displays results in real time, allowing users to try different garments quickly.
Model Files Missing: Ensure that the necessary model files are downloaded and located in the models/ directory. Webcam Not Detected: Verify that your webcam is connected and accessible by your browser or device. Dependency Issues: Run pip install -r requirements.txt to ensure all dependencies are installed. Example Output 📸🖼️ Upon running the script, you will see:
The user's uploaded model image with the garment overlay applied. Key landmarks on the body for alignment. Size recommendations based on body measurements.
Performance: Real-time performance depends on your device’s computational power. Future Enhancements: Plans include adding more robust body and garment segmentation for improved overlay accuracy and compatibility with additional clothing styles. Focal Length Calibration: Modify the focal length in estimate_distance() for more accurate distance estimations, if necessary.
This project is licensed under the MIT License. See the LICENSE file for details.
Manish Dhatrak Email: [email protected] LinkedIn Profile
For any questions or issues, please feel free to reach out. 🤝
Email: [email protected] GitHub: GitHub Profile