Himanshu-AT
commited on
Commit
β’
2c9430c
1
Parent(s):
115fc7b
refactor + discard leaked key
Browse filesThis view is limited to 50 files because it contains too many changes. Β
See raw diff
- .gitattributes +0 -2
- .gitignore +1 -0
- README.md +3 -2
- gradio_demo/app.py β app.py +8 -9
- gradio_demo/apply_net.py β apply_net.py +0 -0
- assets/teaser.png +0 -3
- assets/teaser2.png +0 -3
- ckpt/humanparsing/parsing_atr.onnx +2 -2
- ckpt/humanparsing/parsing_lip.onnx +2 -2
- ckpt/image_encoder/config.json +0 -3
- ckpt/image_encoder/model.safetensors +0 -3
- ckpt/ip_adapter/ip-adapter-plus_sdxl_vit-h.bin +0 -3
- ckpt/openpose/ckpts/body_pose_model.pth +2 -2
- {gradio_demo/densepose β densepose}/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/config.py +0 -0
- {gradio_demo/densepose β densepose}/converters/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/converters/base.py +0 -0
- {gradio_demo/densepose β densepose}/converters/builtin.py +0 -0
- {gradio_demo/densepose β densepose}/converters/chart_output_hflip.py +0 -0
- {gradio_demo/densepose β densepose}/converters/chart_output_to_chart_result.py +0 -0
- {gradio_demo/densepose β densepose}/converters/hflip.py +0 -0
- {gradio_demo/densepose β densepose}/converters/segm_to_mask.py +0 -0
- {gradio_demo/densepose β densepose}/converters/to_chart_result.py +0 -0
- {gradio_demo/densepose β densepose}/converters/to_mask.py +0 -0
- {gradio_demo/densepose β densepose}/data/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/data/build.py +0 -0
- {gradio_demo/densepose β densepose}/data/combined_loader.py +0 -0
- {gradio_demo/densepose β densepose}/data/dataset_mapper.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/builtin.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/chimpnsee.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/coco.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/dataset_type.py +0 -0
- {gradio_demo/densepose β densepose}/data/datasets/lvis.py +0 -0
- {gradio_demo/densepose β densepose}/data/image_list_dataset.py +0 -0
- {gradio_demo/densepose β densepose}/data/inference_based_loader.py +0 -0
- {gradio_demo/densepose β densepose}/data/meshes/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/data/meshes/builtin.py +0 -0
- {gradio_demo/densepose β densepose}/data/meshes/catalog.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_base.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_confidence_based.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_cse_base.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_cse_confidence_based.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_cse_uniform.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/densepose_uniform.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/mask_from_densepose.py +0 -0
- {gradio_demo/densepose β densepose}/data/samplers/prediction_to_gt.py +0 -0
- {gradio_demo/densepose β densepose}/data/transform/__init__.py +0 -0
- {gradio_demo/densepose β densepose}/data/transform/image.py +0 -0
.gitattributes
CHANGED
@@ -33,5 +33,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
-
*.json filter=lfs diff=lfs merge=lfs -text
|
37 |
-
*.png filter=lfs diff=lfs merge=lfs -text
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*.pyc
|
README.md
CHANGED
@@ -5,8 +5,9 @@ colorFrom: blue
|
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: "4.24.0"
|
8 |
-
app_file:
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
|
12 |
# Virtual Try-On Demo
|
@@ -18,5 +19,5 @@ This application is a Virtual Try-On model demonstration powered by Gradio. It a
|
|
18 |
To start the app locally, use the following command:
|
19 |
|
20 |
```bash
|
21 |
-
python
|
22 |
```
|
|
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: "4.24.0"
|
8 |
+
app_file: app.py
|
9 |
pinned: false
|
10 |
+
short_description: Virtual Try-on
|
11 |
---
|
12 |
|
13 |
# Virtual Try-On Demo
|
|
|
19 |
To start the app locally, use the following command:
|
20 |
|
21 |
```bash
|
22 |
+
python app.py
|
23 |
```
|
gradio_demo/app.py β app.py
RENAMED
@@ -1,7 +1,6 @@
|
|
1 |
-
import sys
|
2 |
-
sys.path.append('./')
|
3 |
-
from PIL import Image
|
4 |
import gradio as gr
|
|
|
|
|
5 |
from src.tryon_pipeline import StableDiffusionXLInpaintPipeline as TryonPipeline
|
6 |
from src.unet_hacked_garmnet import UNet2DConditionModel as UNet2DConditionModel_ref
|
7 |
from src.unet_hacked_tryon import UNet2DConditionModel
|
@@ -26,7 +25,6 @@ from preprocess.openpose.run_openpose import OpenPose
|
|
26 |
from detectron2.data.detection_utils import convert_PIL_to_numpy,_apply_exif_orientation
|
27 |
from torchvision.transforms.functional import to_pil_image
|
28 |
|
29 |
-
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
30 |
|
31 |
def pil_to_binary_mask(pil_image, threshold=0):
|
32 |
np_image = np.array(pil_image)
|
@@ -123,7 +121,9 @@ pipe = TryonPipeline.from_pretrained(
|
|
123 |
)
|
124 |
pipe.unet_encoder = UNet_Encoder
|
125 |
|
|
|
126 |
def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
|
|
|
127 |
|
128 |
openpose_model.preprocessor.body_estimation.model.to(device)
|
129 |
pipe.to(device)
|
@@ -258,10 +258,10 @@ for ex_human in human_list_path:
|
|
258 |
##default human
|
259 |
|
260 |
|
261 |
-
image_blocks = gr.Blocks().queue()
|
262 |
with image_blocks as demo:
|
263 |
-
gr.
|
264 |
-
gr.
|
265 |
with gr.Row():
|
266 |
with gr.Column():
|
267 |
imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
@@ -309,5 +309,4 @@ with image_blocks as demo:
|
|
309 |
|
310 |
|
311 |
|
312 |
-
image_blocks.launch(
|
313 |
-
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
from PIL import Image
|
4 |
from src.tryon_pipeline import StableDiffusionXLInpaintPipeline as TryonPipeline
|
5 |
from src.unet_hacked_garmnet import UNet2DConditionModel as UNet2DConditionModel_ref
|
6 |
from src.unet_hacked_tryon import UNet2DConditionModel
|
|
|
25 |
from detectron2.data.detection_utils import convert_PIL_to_numpy,_apply_exif_orientation
|
26 |
from torchvision.transforms.functional import to_pil_image
|
27 |
|
|
|
28 |
|
29 |
def pil_to_binary_mask(pil_image, threshold=0):
|
30 |
np_image = np.array(pil_image)
|
|
|
121 |
)
|
122 |
pipe.unet_encoder = UNet_Encoder
|
123 |
|
124 |
+
@spaces.GPU
|
125 |
def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
|
126 |
+
device = "cuda"
|
127 |
|
128 |
openpose_model.preprocessor.body_estimation.model.to(device)
|
129 |
pipe.to(device)
|
|
|
258 |
##default human
|
259 |
|
260 |
|
261 |
+
image_blocks = gr.Blocks(theme="Nymbo/Alyx_Theme").queue()
|
262 |
with image_blocks as demo:
|
263 |
+
gr.HTML("<center><h1>Virtual Try-On</h1></center>")
|
264 |
+
gr.HTML("<center><p>Upload an image of a person and an image of a garment β¨</p></center>")
|
265 |
with gr.Row():
|
266 |
with gr.Column():
|
267 |
imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
|
|
309 |
|
310 |
|
311 |
|
312 |
+
image_blocks.launch()
|
|
gradio_demo/apply_net.py β apply_net.py
RENAMED
File without changes
|
assets/teaser.png
DELETED
Git LFS Details
|
assets/teaser2.png
DELETED
Git LFS Details
|
ckpt/humanparsing/parsing_atr.onnx
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:04c7d1d070d0e0ae943d86b18cb5aaaea9e278d97462e9cfb270cbbe4cd977f4
|
3 |
+
size 266859305
|
ckpt/humanparsing/parsing_lip.onnx
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8436e1dae96e2601c373d1ace29c8f0978b16357d9038c17a8ba756cca376dbc
|
3 |
+
size 266863411
|
ckpt/image_encoder/config.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:625d37b31afbf2f0792a87846b3654ee23f20568409e35b78a1f795b04e1a7a1
|
3 |
-
size 560
|
|
|
|
|
|
|
|
ckpt/image_encoder/model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ff4265338f828df6c74782f6e1614a5c01d204e7f8bfd46eafa013f3de151d0e
|
3 |
-
size 27
|
|
|
|
|
|
|
|
ckpt/ip_adapter/ip-adapter-plus_sdxl_vit-h.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e8a955fca80fb4ba5718156d2e2619c9fbcd323d7748f44c7d4ce5503763baa0
|
3 |
-
size 24
|
|
|
|
|
|
|
|
ckpt/openpose/ckpts/body_pose_model.pth
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:25a948c16078b0f08e236bda51a385d855ef4c153598947c28c0d47ed94bb746
|
3 |
+
size 209267595
|
{gradio_demo/densepose β densepose}/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/config.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/base.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/builtin.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/chart_output_hflip.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/chart_output_to_chart_result.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/hflip.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/segm_to_mask.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/to_chart_result.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/converters/to_mask.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/build.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/combined_loader.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/dataset_mapper.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/builtin.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/chimpnsee.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/coco.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/dataset_type.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/datasets/lvis.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/image_list_dataset.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/inference_based_loader.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/meshes/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/meshes/builtin.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/meshes/catalog.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_base.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_confidence_based.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_cse_base.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_cse_confidence_based.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_cse_uniform.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/densepose_uniform.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/mask_from_densepose.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/samplers/prediction_to_gt.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/transform/__init__.py
RENAMED
File without changes
|
{gradio_demo/densepose β densepose}/data/transform/image.py
RENAMED
File without changes
|