lixiang46 commited on
Commit
d562784
1 Parent(s): 2a862f6
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -134,7 +134,7 @@ with gr.Blocks(css=css) as Tryon:
134
  image1 = gr.Image(label="Model", scale=1, value="assets/examples/model1.png", show_share_button=False)
135
  image2 = gr.Image(label="Garment", scale=1, value="assets/examples/garment1.png", show_share_button=False)
136
  image3 = gr.Image(label="Result", scale=1, value="assets/examples/result1.png", show_share_button=False)
137
- gr.Examples(
138
  examples=[
139
  ["assets/examples/model1.png", "assets/examples/garment1.png", "assets/examples/result1.png"],
140
  ["assets/examples/model2.png", "assets/examples/garment2.png", "assets/examples/result2.png"]
@@ -142,6 +142,13 @@ with gr.Blocks(css=css) as Tryon:
142
  inputs=[image1, image2, image3],
143
  label=None,
144
  )
 
 
 
 
 
 
 
145
 
146
  ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
147
  print("ip address", ip)
 
134
  image1 = gr.Image(label="Model", scale=1, value="assets/examples/model1.png", show_share_button=False)
135
  image2 = gr.Image(label="Garment", scale=1, value="assets/examples/garment1.png", show_share_button=False)
136
  image3 = gr.Image(label="Result", scale=1, value="assets/examples/result1.png", show_share_button=False)
137
+ show_case = gr.Examples(
138
  examples=[
139
  ["assets/examples/model1.png", "assets/examples/garment1.png", "assets/examples/result1.png"],
140
  ["assets/examples/model2.png", "assets/examples/garment2.png", "assets/examples/result2.png"]
 
142
  inputs=[image1, image2, image3],
143
  label=None,
144
  )
145
+
146
+ gr.on(
147
+ triggers = [show_case.update],
148
+ fn=start_tryon,
149
+ inputs=[image1, image2, seed, randomize_seed],
150
+ outputs=[image_out, seed_used, result_info]
151
+ )
152
 
153
  ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
154
  print("ip address", ip)