FitCheck is a virtual try-on application built for HackUMass 2025. It allows a user to upload a photo of themselves and separate images of clothing, then generates a new, photorealistic image of the user wearing the complete outfit.
Video Demo: https://youtu.be/j7n_oePJHEg
- Upload: The user provides four images: a full-body photo, a shirt, a pair of pants, and a pair of shoes.
- Generate: The frontend sends these images to a Python backend.
- Display: The backend uses the Google Gemini API to analyze the clothing and generate a new composite image of the user wearing the selected items.
- Frontend: HTML, CSS, JavaScript
- Backend: Python 3.9+ with FastAPI and Uvicorn
- AI: Google Gemini API (
gemini-2.5-flash)- Step 1 (Text): The API analyzes the clothing images to create a detailed text description.
- Step 2 (Image): The API uses the user's photo, the text description, and a
generation_config(to force animage/pngresponse) to create the final composite image.
- Python 3.9+
- A Google Gemini API Key
- Visual Studio Code
- The Live Server VSCode extension
- Open a terminal in the project's root directory.
- Create and activate a virtual environment:
# Create the venv python3 -m venv .venv # Activate it (Mac/Linux) source .venv/bin/activate # (Windows) # .\.venv\Scripts\activate
- Install the required Python packages:
pip install fastapi "uvicorn[standard]" google-genai Pillow pip install python-multipart - Open
src/main.pyand paste your Google Gemini API Key into theGOOGLE_API_KEYvariable. - Run the backend server:
The server will run on
python src/main.py or python3 src/main.py #depending on your versionhttp://127.0.0.1:8000. Leave this terminal running.
- In VSCode, right-click the
frontend/index.htmlfile. - Select "Open with Live Server".
- Your browser will open to the app. It will automatically communicate with your backend.
- AI Safety Filters: The Gemini API's safety filters frequently blocked requests, even when using a mannequin. We had to iterate on our prompts to be "safer" and build robust error-handling to catch empty API responses without crashing.
- API Edge Cases: We discovered the API would sometimes return a multi-part response (
[text, image, text]) instead of a single image. We updated our code to loop through the response parts to find the first valid image.