A Streamlit interface application to test the Fashn.ai API and perform virtual clothing try-ons.
- Upload an image of a person or take a photo with the webcam
- Upload an image of a clothing item or take a photo with the webcam
- Generate a virtual image showing how the garment would look on the person
- Real-time progress tracking during processing
- Download the generated results
-
Clone this repository:
git clone <repository-url> cd try-similars -
Install the required dependencies:
pip install -r requirements.txt -
Create a
.envfile with your Fashn.ai API key:FASHN_API_KEY=your_api_key_hereYou can get an API key by registering at Fashn.ai.
-
Run the application:
streamlit run app.py -
Open the provided URL in your web browser (typically http://localhost:8501).
- Upload a photo of a person using the file selector or take a photo with your webcam.
- Upload a photo of a clothing item using the file selector or take a photo with your webcam.
- Select the appropriate clothing category from the dropdown menu (or leave it as "auto").
- Click the "Generate Try-On" button.
- Wait for the processing to complete (it may take up to 40 seconds).
- View the resulting image showing the person wearing the selected garment.
- Download the resulting image if desired.
This application uses the Fashn.ai API, which has the following rate limits:
/run- Up to 50 requests per 60 seconds/status- Up to 50 requests per 10 seconds
For more information about the API, see the Fashn.ai API documentation.
app.py- Main Streamlit applicationrequirements.txt- Python dependencies.env- Environment variables (you must create this file)images/- Directory for storing sample images and resultssamples/- Sample images for testingresults/- Results generated by the API
Refer to the SETUP.md file for detailed setup instructions and troubleshooting tips.