File size: 2,312 Bytes
b41713e
6648d87
 
 
 
b41713e
 
 
 
070332f
b41713e
 
6648d87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: ChitraTech Virtual Try-On
emoji: 👕
colorFrom: pink
colorTo: indigo
sdk: gradio
sdk_version: 6.5.1
app_file: app.py
pinned: false
license: mit
---

# ChitraTech Virtual Try-On

This repository is a Hugging Face Space for an on-demand virtual try-on experience powered by **CatVTON**.

## Planned flow

1. A shopper clicks **Try On** on your ecommerce product page.
2. Your frontend sends the shopper photo and the selected clothing image to this Hugging Face Space.
3. The Space runs CatVTON inference only for that request.
4. The generated try-on image is returned to the frontend for preview.

## Current status

The current Space now includes:
- a Gradio interface for person and garment uploads,
- lazy pipeline initialization for on-demand inference,
- automatic detection of CatVTON code under `CatVTON/`,
- automatic detection of model weights under `checkpoints/CatVTON/`,
- a safe demo fallback when CatVTON is not fully installed yet.

## Repository structure

Recommended layout:
- `app.py`
- `requirements.txt`
- `CatVTON/` for the cloned CatVTON repository
- `checkpoints/CatVTON/` for model weights
- optional `examples/` for demo assets

## Setup steps

### 1. Add CatVTON source code

Clone or copy your CatVTON implementation into:
- `CatVTON/`

If your fork uses a different folder, set:
- `CATVTON_REPO_DIR`

### 2. Add model weights

Place CatVTON checkpoints in:
- `checkpoints/CatVTON/`

Or set:
- `CATVTON_MODEL_DIR`

### 3. Confirm the inference entrypoint

The current app tries common Python and script entrypoints automatically. If your CatVTON fork uses different class names, function names, or CLI arguments, update the loading logic in `app.py`.

### 4. Push to Hugging Face Spaces

After adding the CatVTON repo and weights references, push the repository. Hugging Face will rebuild the Space automatically.

## Frontend integration

Your ecommerce frontend can call the Hugging Face Space directly when needed, making this a free, on-demand approach without keeping a GPU server running continuously.

## Important note

This app is now deployment-ready as a shell, but **real try-on output depends on your exact CatVTON fork and checkpoint format**. If the repository layout differs, `app.py` may need a small adapter for the correct import path or inference call.