Skip to content

Hemkumar247/DrapeAI

Repository files navigation


Gemini Vertex AI React Native FastAPI Firebase


See yourself in any outfit โ€” before you buy it. Upload a clothing image from anywhere. Upload your photo. DrapeAI puts you in it โ€” photorealistically.


GitHub stars GitHub forks


๐Ÿ’ก The Problem

Online shopping has a fundamental flaw โ€” you can't try before you buy.

Return rates in fashion e-commerce exceed 30%, largely because clothing looks different on a model than it does on your actual body. Size guides don't help. Flat product photos don't help. Customer reviews don't help.

DrapeAI solves this with a 4-stage AI pipeline garment analysis, photo validation, photorealistic try-on generation, and intelligent style captioning all in one seamless flow.


๐ŸŽฌ The Full Pipeline

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  STAGE 1 โ€” GARMENT ANALYSIS
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  User uploads clothing image (Pinterest / Zara / H&M / any URL)
                      โ†“
  Gemini 2.0 Flash Vision analyzes the garment:
  โ†’ type, color, pattern, fit, length, fabric, season
  โ†’ quality score (0.0โ€“1.0)
  โ†’ brand detection
  โ†’ validation (rejects blurry / multi-item / non-apparel images)

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  STAGE 2 โ€” USER PHOTO VALIDATION
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  User uploads their full-body photo
                      โ†“
  Gemini validates suitability for try-on:
  โ†’ full body visible? pose? lighting? single person?
  โ†’ returns actionable tip if photo fails
    e.g. "Step back so your full body is visible."

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  STAGE 3 โ€” PHOTOREALISTIC TRY-ON GENERATION
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  Person image + garment image sent to Vertex AI
                      โ†“
  Imagen 3 Virtual Try-On API generates result:
  โ†’ photorealistic image of user wearing the garment
  โ†’ preserves body shape, skin tone, lighting
  โ†’ supports multi-garment (top + bottom + outer)

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  STAGE 4 โ€” AI STYLE CAPTIONING
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  Generated try-on image sent back to Gemini
                      โ†“
  Gemini writes a personal style note:
  โ†’ how the garment fits your frame
  โ†’ color and tone observations
  โ†’ styling suggestions (shoes, accessories, occasion)

โœจ Features

๐Ÿ“ธ Universal Garment Input      โ†’  Any clothing image from Pinterest, Zara, H&M, or screenshots
๐Ÿง  Gemini Garment Analysis      โ†’  Type, color, fit, fabric, pattern, brand โ€” structured metadata
โœ… Smart Photo Validation        โ†’  Actionable rejection tips so every user gets a usable result
๐Ÿช„ Photorealistic Try-On        โ†’  Imagen 3 on Vertex AI โ€” not a filter, actual AI generation
๐Ÿ‘— Multi-Garment Outfits        โ†’  Combine top + bottom + outer for full outfit try-on
๐Ÿค Outfit Compatibility Check   โ†’  AI assesses if pieces work together before generation
๐Ÿ’ฌ Personal Style Caption       โ†’  Gemini writes a style note specific to your result
๐Ÿ’พ Save & Share Looks           โ†’  Save to wardrobe, share results, revisit anytime
drapeAi.live.mp4

๐Ÿ› ๏ธ Tech Stack

Layer Technology Role
AI โ€” Garment & Validation Gemini 2.0 Flash 4-stage multimodal pipeline
AI โ€” Try-On Generation Imagen 3 (Vertex AI) Photorealistic garment overlay
Backend FastAPI (Python) API orchestration + pipeline logic
Frontend React Native + TypeScript Mobile UI (iOS + Android)
Auth / Database Firebase Auth + Firestore User accounts + saved looks
Storage Firebase Cloud Storage Generated try-on images
Navigation React Navigation Screen flow management

๐Ÿง  AI Architecture โ€” 4 Gemini Roles

Role Trigger Output
Garment Analysis User uploads clothing image Structured JSON metadata + quality score
Photo Validation User uploads their photo Pass/fail + actionable fix tip
Outfit Compatibility User adds multiple garments Compatibility score + styling tip
Style Captioning After try-on image generated 2โ€“3 sentence personal style note

๐Ÿ“ฑ Screen Flow

HomeScreen
    โ”œโ”€โ”€ [+ New Try-On]
    โ”‚       โ†“
    โ”‚   AddGarmentScreen  โ†’  Gemini garment analysis  โ†’  metadata card
    โ”‚       โ†“
    โ”‚   AddUserPhotoScreen  โ†’  Gemini validation  โ†’  pass or tip
    โ”‚       โ†“
    โ”‚   GeneratingScreen
    โ”‚       โ†’ "Uploading your images..."     (0โ€“25%)
    โ”‚       โ†’ "Reading your outfit..."       (25โ€“50%)
    โ”‚       โ†’ "Draping your look..."         (50โ€“85%)
    โ”‚       โ†’ "Adding final touches..."      (85โ€“100%)
    โ”‚       โ†“
    โ”‚   ResultScreen  โ†’  try-on image + style caption
    โ”‚       โ”œโ”€โ”€ Save Look
    โ”‚       โ”œโ”€โ”€ Share
    โ”‚       โ”œโ”€โ”€ Try Another
    โ”‚       โ””โ”€โ”€ Find to Buy
    โ”‚
    โ”œโ”€โ”€ [My Wardrobe]  โ†’  saved garment library
    โ””โ”€โ”€ [Saved Looks]  โ†’  generated try-on history

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • Google Gemini API key
  • Google Cloud project with Vertex AI enabled
  • Firebase project (Auth + Firestore + Storage)

Backend Setup

# 1. Clone the repo
git clone https://github.com/Hemkumar247/DrapeAI.git
cd DrapeAI/backend

# 2. Install Python dependencies
pip install -r requirements.txt

# 3. Configure environment
cp .env.example .env
# Add: GEMINI_API_KEY, GOOGLE_CLOUD_PROJECT, Firebase credentials

# 4. Authenticate with Google Cloud
gcloud auth application-default login

# 5. Start the FastAPI server
uvicorn main:app --reload

Frontend Setup

cd DrapeAI/frontend

# Install dependencies
npm install

# Start the app
npx react-native run-android
# or
npx react-native run-ios

API Endpoints

Method Endpoint Description
POST /analyze-garment Gemini garment metadata extraction
POST /validate-user-photo Gemini photo suitability check
POST /check-outfit-compatibility Multi-garment compatibility check
POST /generate-tryon Imagen 3 try-on generation
POST /caption-result Gemini style note generation
GET /wardrobe/:userId Fetch saved garments
POST /save-look Save generated look to Firestore
GET /health API health + Gemini connectivity check

๐Ÿ’ฐ Cost Per Try-On Session

Service Cost (estimate)
Gemini 2.0 Flash (4 calls) ~$0.001
Imagen 3 Virtual Try-On ~$0.04โ€“0.08
Firebase (early stage) Free tier
Total per session ~$0.05โ€“0.12

๐Ÿ”ฎ Roadmap

  • Live deployment (Vercel + Cloud Run)
  • "Find to Buy" โ€” reverse image search to purchase the exact item
  • Size recommendation based on body proportions
  • Social sharing with branded DrapeAI watermark
  • Trending looks feed
  • Browser extension โ€” try-on from any product page

๐Ÿค Contributing

Pull requests and ideas welcome. Open an issue for bugs, features, or collaboration.


๐Ÿง‘โ€๐Ÿ’ป Built by

Hem Kumar โ€” AI + Full-Stack Developer, Chennai ๐Ÿ‡ฎ๐Ÿ‡ณ

Pushing AI into spaces where it genuinely changes how people make decisions.

LinkedIn GitHub Gmail


โญ If DrapeAI made you rethink how AI fits into fashion โ€” drop a star.

About

๐Ÿ‘— Drape AI โ€” A high-fidelity AI Virtual Try-On mobile application powered by Gemini 2.0 Flash and Capacitor. Experience the future of personal styling with real-time garment analysis and neural-driven fashion suggestion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages