This project is a Flask-based application that integrates Twilio for messaging and Gradio for virtual try-on functionality. Users can upload images of themselves and garments, and the application will perform a virtual try-on, sending the result back via WhatsApp.
We have utilized the following HuggingFace Spaces:
Nymbo/Virtual-Try-On, @ HugginFace Space.Nymbo/Mistral-Small-22B, @ HugginFace Space.
Before you begin, ensure you have the following:
- Python 3.9 or higher
- Pip (Python package installer)
- A Twilio account
- Ngrok account (optional for local testing)
-
Create a Twilio Account:
-
Go to Twilio and sign up for a new account.
-
Get a Send a Whatsapp Message section.
-
Now, follow the instructions on the display.
- Redirect to Twilio console, and you will find your Twilio Account SSID & Auth Token.
- Note the Twilio Account SSID & Auth Token (will be required in further steps).
- Setup Ngrok: Open Ngrok Downloads
- Login to Ngrok and note down the Ngrok Auth Token.
- Open terminal, run:
ngrok config add-authtoken TOKEN_VALUE
- Clone repository
git clone https://github.com/ayushr6/Virtual-Clothes-Try-On
cd Virtual-Clothes-Try-On
- Create & Activate environment
conda create -n env-name python=3.x
conda activate env-name
- Install requirements
pip install -r requirements.txt
- Create an
.envfile and add the following Auth, & Tokens
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
NGROK_URL=
NOTE: to get the NGROK_URL, run the below command:
ngrok http 8080
Under the Ngork details, copy the URL from in-front of Forwarding and set the NGROK_URL environment variable.
Note: With this command, your local server will be accessible to everyone.
*Everytime you restart your ngrok server, new url will be generated. So, don't forget to update the env and Twilio Sandbox Configuration.
ngrok http 8080
python app.py
- After setting up all environment variables, and twilio account.
- Open Twilio chat on whatsapp, and type "Hi" or send an image.
- Share your image or someone's else.
- Share a garment image you want to try-on.
That's all; it's that simple!
