Himanshu-AT commited on
Commit
2c9430c
β€’
1 Parent(s): 115fc7b

refactor + discard leaked key

Browse files
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. .gitattributes +0 -2
  2. .gitignore +1 -0
  3. README.md +3 -2
  4. gradio_demo/app.py β†’ app.py +8 -9
  5. gradio_demo/apply_net.py β†’ apply_net.py +0 -0
  6. assets/teaser.png +0 -3
  7. assets/teaser2.png +0 -3
  8. ckpt/humanparsing/parsing_atr.onnx +2 -2
  9. ckpt/humanparsing/parsing_lip.onnx +2 -2
  10. ckpt/image_encoder/config.json +0 -3
  11. ckpt/image_encoder/model.safetensors +0 -3
  12. ckpt/ip_adapter/ip-adapter-plus_sdxl_vit-h.bin +0 -3
  13. ckpt/openpose/ckpts/body_pose_model.pth +2 -2
  14. {gradio_demo/densepose β†’ densepose}/__init__.py +0 -0
  15. {gradio_demo/densepose β†’ densepose}/config.py +0 -0
  16. {gradio_demo/densepose β†’ densepose}/converters/__init__.py +0 -0
  17. {gradio_demo/densepose β†’ densepose}/converters/base.py +0 -0
  18. {gradio_demo/densepose β†’ densepose}/converters/builtin.py +0 -0
  19. {gradio_demo/densepose β†’ densepose}/converters/chart_output_hflip.py +0 -0
  20. {gradio_demo/densepose β†’ densepose}/converters/chart_output_to_chart_result.py +0 -0
  21. {gradio_demo/densepose β†’ densepose}/converters/hflip.py +0 -0
  22. {gradio_demo/densepose β†’ densepose}/converters/segm_to_mask.py +0 -0
  23. {gradio_demo/densepose β†’ densepose}/converters/to_chart_result.py +0 -0
  24. {gradio_demo/densepose β†’ densepose}/converters/to_mask.py +0 -0
  25. {gradio_demo/densepose β†’ densepose}/data/__init__.py +0 -0
  26. {gradio_demo/densepose β†’ densepose}/data/build.py +0 -0
  27. {gradio_demo/densepose β†’ densepose}/data/combined_loader.py +0 -0
  28. {gradio_demo/densepose β†’ densepose}/data/dataset_mapper.py +0 -0
  29. {gradio_demo/densepose β†’ densepose}/data/datasets/__init__.py +0 -0
  30. {gradio_demo/densepose β†’ densepose}/data/datasets/builtin.py +0 -0
  31. {gradio_demo/densepose β†’ densepose}/data/datasets/chimpnsee.py +0 -0
  32. {gradio_demo/densepose β†’ densepose}/data/datasets/coco.py +0 -0
  33. {gradio_demo/densepose β†’ densepose}/data/datasets/dataset_type.py +0 -0
  34. {gradio_demo/densepose β†’ densepose}/data/datasets/lvis.py +0 -0
  35. {gradio_demo/densepose β†’ densepose}/data/image_list_dataset.py +0 -0
  36. {gradio_demo/densepose β†’ densepose}/data/inference_based_loader.py +0 -0
  37. {gradio_demo/densepose β†’ densepose}/data/meshes/__init__.py +0 -0
  38. {gradio_demo/densepose β†’ densepose}/data/meshes/builtin.py +0 -0
  39. {gradio_demo/densepose β†’ densepose}/data/meshes/catalog.py +0 -0
  40. {gradio_demo/densepose β†’ densepose}/data/samplers/__init__.py +0 -0
  41. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_base.py +0 -0
  42. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_confidence_based.py +0 -0
  43. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_cse_base.py +0 -0
  44. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_cse_confidence_based.py +0 -0
  45. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_cse_uniform.py +0 -0
  46. {gradio_demo/densepose β†’ densepose}/data/samplers/densepose_uniform.py +0 -0
  47. {gradio_demo/densepose β†’ densepose}/data/samplers/mask_from_densepose.py +0 -0
  48. {gradio_demo/densepose β†’ densepose}/data/samplers/prediction_to_gt.py +0 -0
  49. {gradio_demo/densepose β†’ densepose}/data/transform/__init__.py +0 -0
  50. {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: gradio_demo/app.py
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 gradio_demo/app.py
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.Markdown("## IDM-VTON πŸ‘•πŸ‘”πŸ‘š")
264
- gr.Markdown("Virtual Try-on with your image and garment image. Check out the [source codes](https://github.com/yisol/IDM-VTON) and the [model](https://huggingface.co/yisol/IDM-VTON)")
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(share=True)
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

  • SHA256: e0ff5c96023ddf67864dc49acde2fab6a0c982fd77aa4979d9a2e77f45ad0b82
  • Pointer size: 132 Bytes
  • Size of remote file: 7.06 MB
assets/teaser2.png DELETED

Git LFS Details

  • SHA256: 4a2c3522cb7805407f437f1639418166477f334cbef739e06947b5dfc68a1968
  • Pointer size: 132 Bytes
  • Size of remote file: 9.02 MB
ckpt/humanparsing/parsing_atr.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3a248ff77aea7799b1a5ad036837e0b50c59b5fb95a2970e28d86b0a31b0cc73
3
- size 25
 
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:67f9c02ab458afa087bc02e18a9df5e479aebe48e291f46e9de6452cc3b97d37
3
- size 25
 
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:1014e5f51f5e838d02528a05837437f0f7424a9bfb90c2d6a55f0c73db2c0e0f
3
- size 28
 
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