selfitcamera commited on
Commit
2105e3c
1 Parent(s): b4c4614
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -13,7 +13,7 @@ def onClick(cloth_id, pose_image, pose_id, size, request: gr.Request):
13
  # print(pose_id, cloth_id, size, (pose_image is None), len(pose_id)>0)
14
  if len(pose_id)>0:
15
  res = get_result_example(cloth_id, pose_id)
16
- # print(res)
17
  assert os.path.exists(res), res
18
  return res, "Done! Use the pre-run results directly, the cloth size does not take effect "
19
  else:
@@ -108,7 +108,9 @@ with gr.Blocks(css=css) as demo:
108
  with gr.Row():
109
  with gr.Column():
110
  with gr.Column():
111
- cloth_image = gr.Image(type="numpy", value=cloth_examples[0][1], label="")
 
 
112
  cloth_id = gr.Label(value=cloth_examples[0][0], label="Clothing 3D Model", visible=False)
113
  example = gr.Examples(inputs=[cloth_id, cloth_image],
114
  examples_per_page=3,
@@ -118,7 +120,7 @@ with gr.Blocks(css=css) as demo:
118
  # pose_image = gr.Image(source='upload', value=pose_examples[0][1],
119
  # type="numpy", label="")
120
  pose_image = gr.Image(value=pose_examples[0][1],
121
- type="numpy", label="")
122
  pose_id = gr.Label(value=pose_examples[0][0], label="Pose Image", visible=False)
123
  example_pose = gr.Examples(inputs=[pose_id, pose_image],
124
  examples_per_page=3,
@@ -130,7 +132,7 @@ with gr.Blocks(css=css) as demo:
130
  run_button = gr.Button(value="Run")
131
 
132
  init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
133
- res_image = gr.Image(label="result image", value=init_res)
134
  info_text = gr.Textbox(value="", interactive=False,
135
  label='runtime information')
136
 
 
13
  # print(pose_id, cloth_id, size, (pose_image is None), len(pose_id)>0)
14
  if len(pose_id)>0:
15
  res = get_result_example(cloth_id, pose_id)
16
+ print(res)
17
  assert os.path.exists(res), res
18
  return res, "Done! Use the pre-run results directly, the cloth size does not take effect "
19
  else:
 
108
  with gr.Row():
109
  with gr.Column():
110
  with gr.Column():
111
+ # cloth_image = gr.Image(type="numpy", value=cloth_examples[0][1], label="")
112
+ cloth_image = gr.Image(sources='clipboard', type="filepath", label="",
113
+ value=cloth_examples[0][1])
114
  cloth_id = gr.Label(value=cloth_examples[0][0], label="Clothing 3D Model", visible=False)
115
  example = gr.Examples(inputs=[cloth_id, cloth_image],
116
  examples_per_page=3,
 
120
  # pose_image = gr.Image(source='upload', value=pose_examples[0][1],
121
  # type="numpy", label="")
122
  pose_image = gr.Image(value=pose_examples[0][1],
123
+ type="numpy", label="")
124
  pose_id = gr.Label(value=pose_examples[0][0], label="Pose Image", visible=False)
125
  example_pose = gr.Examples(inputs=[pose_id, pose_image],
126
  examples_per_page=3,
 
132
  run_button = gr.Button(value="Run")
133
 
134
  init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
135
+ res_image = gr.Image(label="result image", value=init_res, type="filepath")
136
  info_text = gr.Textbox(value="", interactive=False,
137
  label='runtime information')
138