brjathu commited on
Commit
72aecd3
1 Parent(s): 998dfa8
Files changed (1) hide show
  1. app.py +12 -19
app.py CHANGED
@@ -134,9 +134,9 @@ def infer(in_pil_img, in_threshold=0.8, out_pil_img=None):
134
  # convert to PIL image
135
  out_pil_img = Image.fromarray((input_img_overlay*255).astype(np.uint8))
136
 
137
- return out_pil_img
138
  else:
139
- return None
140
 
141
 
142
  with gr.Blocks(title="4DHumans", css=".gradio-container") as demo:
@@ -148,15 +148,14 @@ with gr.Blocks(title="4DHumans", css=".gradio-container") as demo:
148
  input_image = gr.Image(label="Input image", type="pil")
149
  with gr.Column():
150
  output_image = gr.Image(label="Reconstructions", type="pil")
151
- # output_meshes = gr.File(label="3D meshes")
152
 
153
  gr.HTML("""<br/>""")
154
 
155
  with gr.Row():
156
  threshold = gr.Slider(0, 1.0, value=0.6, label='Detection Threshold')
157
  send_btn = gr.Button("Infer")
158
- send_btn.click(fn=infer, inputs=[input_image, threshold], outputs=[output_image])
159
-
160
 
161
  # gr.Examples([
162
  # ['assets/test1.png', 0.6],
@@ -167,20 +166,14 @@ with gr.Blocks(title="4DHumans", css=".gradio-container") as demo:
167
  # ],
168
  # inputs=[input_image, threshold])
169
 
170
- # with gr.Row():
171
- # gr.Examples([
172
- # ['assets/test1.png'],
173
- # ['assets/test2.jpg'],
174
- # ['assets/test3.jpg'],
175
- # ['assets/test4.jpg'],
176
- # ['assets/test5.jpg'],
177
- # ],
178
-
179
- # inputs=[input_image, 0.6],
180
- # outputs = [
181
- # output_image
182
- # ],
183
- # )
184
 
185
 
186
  #demo.queue()
 
134
  # convert to PIL image
135
  out_pil_img = Image.fromarray((input_img_overlay*255).astype(np.uint8))
136
 
137
+ return out_pil_img, all_mesh_paths
138
  else:
139
+ return None, []
140
 
141
 
142
  with gr.Blocks(title="4DHumans", css=".gradio-container") as demo:
 
148
  input_image = gr.Image(label="Input image", type="pil")
149
  with gr.Column():
150
  output_image = gr.Image(label="Reconstructions", type="pil")
151
+ output_meshes = gr.File(label="3D meshes")
152
 
153
  gr.HTML("""<br/>""")
154
 
155
  with gr.Row():
156
  threshold = gr.Slider(0, 1.0, value=0.6, label='Detection Threshold')
157
  send_btn = gr.Button("Infer")
158
+ send_btn.click(fn=infer, inputs=[input_image, threshold], outputs=[output_image, output_meshes])
 
159
 
160
  # gr.Examples([
161
  # ['assets/test1.png', 0.6],
 
166
  # ],
167
  # inputs=[input_image, threshold])
168
 
169
+ gr.Examples([
170
+ ['assets/test1.png'],
171
+ ['assets/test2.jpg'],
172
+ ['assets/test3.jpg'],
173
+ ['assets/test4.jpg'],
174
+ ['assets/test5.jpg'],
175
+ ],
176
+ inputs=[input_image, 0.6])
 
 
 
 
 
 
177
 
178
 
179
  #demo.queue()