File size: 1,774 Bytes
a76857e
 
 
 
 
 
 
 
5edd223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
75
76
77
78
---
datasets:
- TryOnVirtual/VITON-HD-IMAGE
language:
- en
base_model:
- zhengchong/CatVTON
---
# Fashibles




## Installation

Create a conda environment & Install requirments
```shell
conda create -n catvton python==3.9.0
conda activate catvton
cd CatVTON-fashable  # or your path to CatVTON project dir
pip install -r requirements.txt
```

## Run the Project First Init
This will full the pretrained freeze models
```shell
python app.py \
--output_dir="resource/demo/output" \
--mixed_precision="bf16" \
--allow_tf32 
```

## Run as an API Server
```shell
python app_api.py
```

## API Call Sample Payload
```js
import axios from "axios";

const form = new FormData();
form.append("person_image", "/Users/ahmadabdulnasirshuaib/wsp/ml-al/clothChanger/assets/istockphoto-521071031-612x612.jpg");
form.append("cloth_image", "/Users/ahmadabdulnasirshuaib/wsp/ml-al/clothChanger/resource/demo/example/condition/upper/24083449_54173465_2048.jpg");
form.append("cloth_type", "upper");

const options = {
  method: 'POST',
  url: 'http://127.0.0.1:8000/process_images',
  headers: {
    'Content-Type': 'multipart/form-data; boundary=---011000010111000001101001',
    'User-Agent': 'insomnia/9.3.3'
  },
  data: '[form]'
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});

```
### Gradio App

To deploy the Gradio App for CatVTON on your machine, run the following command, and checkpoints will be automatically downloaded from HuggingFace.

```shell
CUDA_VISIBLE_DEVICES=0 python app.py \
--output_dir="resource/demo/output" \
--mixed_precision="bf16" \
--allow_tf32 
```

When using `bf16` precision, generating results with a resolution of `1024x768` only requires about `8G` VRAM.


##