HumanAIGC commited on
Commit
a01b0e0
1 Parent(s): 419cfa8

parallel gpu

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,12 +4,14 @@ import numpy as np
4
  import json
5
  import random
6
  from PIL import Image, ImageDraw, ImageFont
 
7
 
8
  import requests
9
  import base64
10
  import gradio as gr
11
  # from IPython import embed
12
 
 
13
  model = os.path.join(os.path.dirname(__file__), "models/eva/Eva_0.png")
14
 
15
  MODEL_MAP = {
@@ -41,10 +43,8 @@ def add_waterprint(img):
41
  return img
42
 
43
 
44
-
45
  def get_tryon_result(model_name, garment1, garment2, seed=1234):
46
 
47
-
48
  # model_name = "AI Model " + model_name.split("\\")[-1].split(".")[0] # windows
49
  model_name = "AI Model " + model_name.split("/")[-1].split(".")[0] # linux
50
  print(model_name)
@@ -163,7 +163,8 @@ with gr.Blocks(css = ".output-image, .input-image, .image-preview {height: 400px
163
  garment_top,
164
  garment_down,
165
  ],
166
- outputs=[gallery])
 
167
 
168
 
169
  # Examples
 
4
  import json
5
  import random
6
  from PIL import Image, ImageDraw, ImageFont
7
+ import asyncio
8
 
9
  import requests
10
  import base64
11
  import gradio as gr
12
  # from IPython import embed
13
 
14
+ machine_number = 0
15
  model = os.path.join(os.path.dirname(__file__), "models/eva/Eva_0.png")
16
 
17
  MODEL_MAP = {
 
43
  return img
44
 
45
 
 
46
  def get_tryon_result(model_name, garment1, garment2, seed=1234):
47
 
 
48
  # model_name = "AI Model " + model_name.split("\\")[-1].split(".")[0] # windows
49
  model_name = "AI Model " + model_name.split("/")[-1].split(".")[0] # linux
50
  print(model_name)
 
163
  garment_top,
164
  garment_down,
165
  ],
166
+ outputs=[gallery],
167
+ concurrency_limit=2)
168
 
169
 
170
  # Examples