README.md CHANGED
@@ -4,11 +4,10 @@ emoji: πŸ‘•
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 4.43.0
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
- disable_embedding: true
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 4.38.1
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
 
11
  ---
12
 
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -12,7 +12,6 @@ import time
12
  def tryon(person_img, garment_img, seed, randomize_seed):
13
  post_start_time = time.time()
14
  if person_img is None or garment_img is None:
15
- gr.Warning("Empty image")
16
  return None, None, "Empty image"
17
  if randomize_seed:
18
  seed = random.randint(0, MAX_SEED)
@@ -48,7 +47,7 @@ def tryon(person_img, garment_img, seed, randomize_seed):
48
 
49
  get_start_time =time.time()
50
  time.sleep(9)
51
- Max_Retry = 12
52
  result_img = None
53
  info = ""
54
  err_log = ""
@@ -70,15 +69,13 @@ def tryon(person_img, garment_img, seed, randomize_seed):
70
  elif status == "error":
71
  err_log = f"Status is Error"
72
  info = "Error"
73
- break
74
  else:
75
  # print(response.text)
76
  err_log = "URL error, pleace contact the admin"
77
  info = "URL error, pleace contact the admin"
78
- break
79
  except requests.exceptions.ReadTimeout:
80
  err_log = "Http Timeout"
81
- info = "Http Timeout, please try again later"
82
  except Exception as err:
83
  err_log = f"Get Exception Error: {err}"
84
  time.sleep(1)
@@ -90,7 +87,7 @@ def tryon(person_img, garment_img, seed, randomize_seed):
90
  info = "Too many users, please try again later"
91
  if info != "Success":
92
  print(f"Error Log: {err_log}")
93
- gr.Warning("Too many users, please try again later")
94
 
95
  return result_img, seed, info
96
 
@@ -250,7 +247,7 @@ with gr.Blocks(css=css) as Tryon:
250
 
251
 
252
  # try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon',concurrency_limit=10)
253
- test_button.click(fn=tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name=False, concurrency_limit=45)
254
 
255
  with gr.Column(elem_id = "col-showcase"):
256
  gr.HTML("""
@@ -272,4 +269,6 @@ with gr.Blocks(css=css) as Tryon:
272
  label=None
273
  )
274
 
275
- Tryon.queue(api_open=False).launch(show_api=False)
 
 
 
12
  def tryon(person_img, garment_img, seed, randomize_seed):
13
  post_start_time = time.time()
14
  if person_img is None or garment_img is None:
 
15
  return None, None, "Empty image"
16
  if randomize_seed:
17
  seed = random.randint(0, MAX_SEED)
 
47
 
48
  get_start_time =time.time()
49
  time.sleep(9)
50
+ Max_Retry = 10
51
  result_img = None
52
  info = ""
53
  err_log = ""
 
69
  elif status == "error":
70
  err_log = f"Status is Error"
71
  info = "Error"
 
72
  else:
73
  # print(response.text)
74
  err_log = "URL error, pleace contact the admin"
75
  info = "URL error, pleace contact the admin"
 
76
  except requests.exceptions.ReadTimeout:
77
  err_log = "Http Timeout"
78
+ info = "Too many users, please try again later"
79
  except Exception as err:
80
  err_log = f"Get Exception Error: {err}"
81
  time.sleep(1)
 
87
  info = "Too many users, please try again later"
88
  if info != "Success":
89
  print(f"Error Log: {err_log}")
90
+ raise gr.Error("Too many users, please try again later")
91
 
92
  return result_img, seed, info
93
 
 
247
 
248
 
249
  # try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon',concurrency_limit=10)
250
+ test_button.click(fn=tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon', concurrency_limit=45)
251
 
252
  with gr.Column(elem_id = "col-showcase"):
253
  gr.HTML("""
 
269
  label=None
270
  )
271
 
272
+ # ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
273
+ # print("ip address", ip)
274
+ Tryon.launch()
assets/human/000.png CHANGED

Git LFS Details

  • SHA256: 4468e2870e21a158a02e26fa6e5340beb80bd55814b01781c25a3677af1a7f00
  • Pointer size: 132 Bytes
  • Size of remote file: 1.5 MB

Git LFS Details

  • SHA256: bde67fd9e90cda310f13949829517f662b1e956f929e32e315eabbc19549f44f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.39 MB
assets/human/001.png CHANGED

Git LFS Details

  • SHA256: 05e4a0fba389106486e4726d4d3acc13ceb22637080324985cdd9cea8aa9974a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB

Git LFS Details

  • SHA256: 71b791e1a59db26b3e9315032977450565bfd26f7385b53e4546bfe453394c1e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.23 MB
assets/human/002.png CHANGED

Git LFS Details

  • SHA256: bde67fd9e90cda310f13949829517f662b1e956f929e32e315eabbc19549f44f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.39 MB

Git LFS Details

  • SHA256: 4468e2870e21a158a02e26fa6e5340beb80bd55814b01781c25a3677af1a7f00
  • Pointer size: 132 Bytes
  • Size of remote file: 1.5 MB
assets/human/003.png CHANGED

Git LFS Details

  • SHA256: 71b791e1a59db26b3e9315032977450565bfd26f7385b53e4546bfe453394c1e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.23 MB

Git LFS Details

  • SHA256: 05e4a0fba389106486e4726d4d3acc13ceb22637080324985cdd9cea8aa9974a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB
assets/title.md CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e1e2eed7722bd033f855d2a38c7d2be687e147252e8be3ab488a7cab13ad2417
3
- size 1193
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9c071c86fdb5c23e62feb6f68dc7c537c7cfe67fd5fa2c66a263be3b47e0fb0
3
+ size 633