lixiang46 commited on
Commit
39cd34c
1 Parent(s): 8c2fca3

add examepls

Browse files
.gitattributes CHANGED
@@ -36,3 +36,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  assets/cloth filter=lfs diff=lfs merge=lfs -text
37
  assets/human filter=lfs diff=lfs merge=lfs -text
38
  assets/title.md filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
36
  assets/cloth filter=lfs diff=lfs merge=lfs -text
37
  assets/human filter=lfs diff=lfs merge=lfs -text
38
  assets/title.md filter=lfs diff=lfs merge=lfs -text
39
+ assets/examples filter=lfs diff=lfs merge=lfs -text
40
+ assets/examples/result1.png filter=lfs diff=lfs merge=lfs -text
41
+ assets/examples/garment1.png filter=lfs diff=lfs merge=lfs -text
42
+ assets/examples/model1.png filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -14,7 +14,6 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
14
  seed = random.randint(0, MAX_SEED)
15
  encoded_person_img = cv2.imencode('.jpg', cv2.cvtColor(person_img, cv2.COLOR_RGB2BGR))[1].tobytes()
16
  encoded_person_img = base64.b64encode(encoded_person_img).decode('utf-8')
17
- print(encoded_person_img)
18
  encoded_garment_img = cv2.imencode('.jpg', cv2.cvtColor(garment_img, cv2.COLOR_RGB2BGR))[1].tobytes()
19
  encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
20
 
@@ -119,10 +118,17 @@ with gr.Blocks(css=css) as Tryon:
119
 
120
  try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon')
121
 
122
- # with gr.Row(label="Examples"):
123
- # with gr.Column(elem_id = "col-left"):
124
- # imgs = gr.Image(label="Person image", sources='upload', type="numpy")
125
-
 
 
 
 
 
 
 
126
 
127
  ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
128
  print("ip address", ip)
 
14
  seed = random.randint(0, MAX_SEED)
15
  encoded_person_img = cv2.imencode('.jpg', cv2.cvtColor(person_img, cv2.COLOR_RGB2BGR))[1].tobytes()
16
  encoded_person_img = base64.b64encode(encoded_person_img).decode('utf-8')
 
17
  encoded_garment_img = cv2.imencode('.jpg', cv2.cvtColor(garment_img, cv2.COLOR_RGB2BGR))[1].tobytes()
18
  encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
19
 
 
118
 
119
  try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon')
120
 
121
+ with gr.Row(label="Examples"):
122
+ image1 = gr.Image(label="model", scale=1, value="examples/model1.png")
123
+ image2 = gr.Image(label="garment", scale=1, value="examples/garment1.jpg")
124
+ image3 = gr.Image(label="result", scale=1, value="examples/result1.png")
125
+ gr.Examples(
126
+ examples=[
127
+ ["examples/model1.png", "examples/garment1.png", "examples/result1.png"]
128
+ ],
129
+ inputs=[image1, image2, image3],
130
+ label=None,
131
+ )
132
 
133
  ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
134
  print("ip address", ip)
assets/examples/garment1.png ADDED

Git LFS Details

  • SHA256: 6eae5a16e07d759d40269c0955f36200ba636f0a0cc350c9ee6ba2a1f2a96da7
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
assets/examples/model1.png ADDED

Git LFS Details

  • SHA256: 4468e2870e21a158a02e26fa6e5340beb80bd55814b01781c25a3677af1a7f00
  • Pointer size: 132 Bytes
  • Size of remote file: 1.5 MB
assets/examples/result1.png ADDED

Git LFS Details

  • SHA256: bf803b9dd952cf14976e4d0b0aa40e82fabc58e0587d93482285bbfe01181626
  • Pointer size: 131 Bytes
  • Size of remote file: 988 kB