lixiang46
commited on
Commit
·
534e5bb
1
Parent(s):
f69cd15
update
Browse files- README.md +2 -2
- app.py +14 -5
- assets/title.md +2 -2
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title: Kolors Tryon
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Kolors Visual Tryon
|
| 3 |
+
emoji: 👕
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
app.py
CHANGED
|
@@ -5,15 +5,18 @@ from PIL import Image
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
import random
|
|
|
|
| 8 |
|
| 9 |
-
example_path = os.path.join(os.path.dirname(__file__), 'assets')
|
| 10 |
-
|
| 11 |
-
MAX_SEED = 999999
|
| 12 |
|
|
|
|
| 13 |
def start_tryon(imgs, garm_img, garment_des, seed):
|
| 14 |
|
| 15 |
return None
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
garm_list = os.listdir(os.path.join(example_path,"cloth"))
|
| 18 |
garm_list_path = [os.path.join(example_path,"cloth",garm) for garm in garm_list]
|
| 19 |
|
|
@@ -63,8 +66,14 @@ with gr.Blocks(css=css) as Tryon:
|
|
| 63 |
|
| 64 |
with gr.Column():
|
| 65 |
with gr.Accordion(label="Advanced Settings", open=False):
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed], outputs=[image_out], api_name='tryon')
|
| 70 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
import random
|
| 8 |
+
import spaces
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
@spaces.GPU
|
| 12 |
def start_tryon(imgs, garm_img, garment_des, seed):
|
| 13 |
|
| 14 |
return None
|
| 15 |
|
| 16 |
+
MAX_SEED = 999999
|
| 17 |
+
|
| 18 |
+
example_path = os.path.join(os.path.dirname(__file__), 'assets')
|
| 19 |
+
|
| 20 |
garm_list = os.listdir(os.path.join(example_path,"cloth"))
|
| 21 |
garm_list_path = [os.path.join(example_path,"cloth",garm) for garm in garm_list]
|
| 22 |
|
|
|
|
| 66 |
|
| 67 |
with gr.Column():
|
| 68 |
with gr.Accordion(label="Advanced Settings", open=False):
|
| 69 |
+
seed = gr.Slider(
|
| 70 |
+
label="Seed",
|
| 71 |
+
minimum=0,
|
| 72 |
+
maximum=MAX_SEED,
|
| 73 |
+
step=1,
|
| 74 |
+
value=0,
|
| 75 |
+
)
|
| 76 |
+
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
| 77 |
|
| 78 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed], outputs=[image_out], api_name='tryon')
|
| 79 |
|
assets/title.md
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:79f28d9f0cc8ac8b370ab4bf945a9450dfb6c7febdf3c56d26b1cecd4d386632
|
| 3 |
+
size 604
|