selfitcamera commited on
Commit
f39f01a
1 Parent(s): d9b1803
Files changed (4) hide show
  1. Datas/tip1.jpg +0 -0
  2. Datas/tip2.jpg +0 -0
  3. app.py +6 -1
  4. utils.py +5 -0
Datas/tip1.jpg ADDED
Datas/tip2.jpg ADDED
app.py CHANGED
@@ -5,6 +5,7 @@ from utils import *
5
 
6
  cloth_examples = get_cloth_examples()
7
  pose_examples = get_pose_examples()
 
8
 
9
  # Description
10
  title = r"""
@@ -118,6 +119,10 @@ with gr.Blocks(css=css) as demo:
118
  gr.Markdown(title)
119
  gr.Markdown(description)
120
 
 
 
 
 
121
  with gr.Row():
122
  with gr.Column():
123
  with gr.Column():
@@ -138,10 +143,10 @@ with gr.Blocks(css=css) as demo:
138
  example_pose = gr.Examples(inputs=[pose_id, pose_image],
139
  examples_per_page=3,
140
  examples=pose_examples)
141
- size_slider = gr.Slider(-2.5, 2.5, value=1, interactive=True, label="clothes size")
142
 
143
  with gr.Column():
144
  with gr.Column():
 
145
  run_button = gr.Button(value="Run")
146
  init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
147
  res_image = gr.Image(label="result image", value=None, type="filepath")
 
5
 
6
  cloth_examples = get_cloth_examples()
7
  pose_examples = get_pose_examples()
8
+ tip1, tip2 = get_tips()
9
 
10
  # Description
11
  title = r"""
 
119
  gr.Markdown(title)
120
  gr.Markdown(description)
121
 
122
+ with gr.Accordion('upload tips', open=False):
123
+ tip_image1 = gr.Image(value=tip1)
124
+ tip_image2 = gr.Image(value=tip2)
125
+
126
  with gr.Row():
127
  with gr.Column():
128
  with gr.Column():
 
143
  example_pose = gr.Examples(inputs=[pose_id, pose_image],
144
  examples_per_page=3,
145
  examples=pose_examples)
 
146
 
147
  with gr.Column():
148
  with gr.Column():
149
+ size_slider = gr.Slider(-2.5, 2.5, value=1, interactive=True, label="clothes size")
150
  run_button = gr.Button(value="Run")
151
  init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
152
  res_image = gr.Image(label="result image", value=None, type="filepath")
utils.py CHANGED
@@ -47,6 +47,11 @@ def get_result_example(cloth_id, pose_id):
47
  res_path = os.path.join(result_dir, f"{cloth_id}_{pose_id}.jpg")
48
  return res_path
49
 
 
 
 
 
 
50
  def getAllInfs(apiUrl, openId, apiKey, clientIp):
51
  params = {'openId':openId, 'apiKey':apiKey, 'ipId':clientIp}
52
  session = requests.session()
 
47
  res_path = os.path.join(result_dir, f"{cloth_id}_{pose_id}.jpg")
48
  return res_path
49
 
50
+ def get_tips():
51
+ path1 = os.path.join(data_dir, 'tip1.jpg')
52
+ path2 = os.path.join(data_dir, 'tip2.jpg')
53
+ return path1, path2
54
+
55
  def getAllInfs(apiUrl, openId, apiKey, clientIp):
56
  params = {'openId':openId, 'apiKey':apiKey, 'ipId':clientIp}
57
  session = requests.session()