vibs08 commited on
Commit
d4395e7
·
verified ·
1 Parent(s): da948a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -193,8 +193,8 @@ def run_example(image, do_remove_background, foreground_ratio, mc_resolution, te
193
  image_pil = generate_image_from_text(encoded_image=image, pos_prompt=text_prompt)
194
  else:
195
  image_pil = generate_image_from_text(encoded_image=image)
196
- preprocessed = preprocess(image_pil, do_remove_background, foreground_ratio)
197
- mesh_name_obj, mesh_name_glb = generate(preprocessed, mc_resolution, ["obj", "glb"])
198
  return preprocessed, mesh_name_obj, mesh_name_glb
199
 
200
  with gr.Blocks() as demo:
@@ -209,7 +209,7 @@ with gr.Blocks() as demo:
209
  sources="upload",
210
  type="pil",
211
  elem_id="content_image",
212
- visible=True # Hidden since we generate the image from text
213
  )
214
  text_prompt = gr.Textbox(
215
  label="Text Prompt",
@@ -264,7 +264,7 @@ with gr.Blocks() as demo:
264
  # )
265
  submit.click(fn=check_input_image, inputs=[input_image]).success(
266
  fn=run_example,
267
- inputs=[input_image,text_prompt, do_remove_background, foreground_ratio, mc_resolution],
268
  outputs=[processed_image, output_model_obj, output_model_glb],
269
  # outputs=[output_model_obj, output_model_glb],
270
  )
 
193
  image_pil = generate_image_from_text(encoded_image=image, pos_prompt=text_prompt)
194
  else:
195
  image_pil = generate_image_from_text(encoded_image=image)
196
+ preprocessed = preprocess(image_pil, False, 0.9)
197
+ mesh_name_obj, mesh_name_glb = generate(preprocessed, 256, ["obj", "glb"])
198
  return preprocessed, mesh_name_obj, mesh_name_glb
199
 
200
  with gr.Blocks() as demo:
 
209
  sources="upload",
210
  type="pil",
211
  elem_id="content_image",
212
+ visible=True
213
  )
214
  text_prompt = gr.Textbox(
215
  label="Text Prompt",
 
264
  # )
265
  submit.click(fn=check_input_image, inputs=[input_image]).success(
266
  fn=run_example,
267
+ inputs=[input_image, do_remove_background, foreground_ratio, mc_resolution, text_prompt],
268
  outputs=[processed_image, output_model_obj, output_model_glb],
269
  # outputs=[output_model_obj, output_model_glb],
270
  )