dev-bjoern commited on
Commit
822ace9
Β·
1 Parent(s): 1ed02fd

Fix 3D preview output binding

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -245,8 +245,10 @@ with gr.Blocks(title="SAM 3D Objects MCP") as demo:
245
  reconstruct_btn = gr.Button("πŸš€ Reconstruct 3D", variant="primary", size="lg")
246
 
247
  with gr.Row():
248
- output_model = gr.Model3D(label="3D Preview")
249
- output_file = gr.File(label="Download GLB")
 
 
250
 
251
  # Events
252
  segment_btn.click(
@@ -264,8 +266,9 @@ with gr.Blocks(title="SAM 3D Objects MCP") as demo:
264
  reconstruct_btn.click(
265
  reconstruct_3d,
266
  inputs=[input_image, mask_state],
267
- outputs=[output_file, status]
268
  )
 
269
 
270
  gr.Markdown("""
271
  ---
 
245
  reconstruct_btn = gr.Button("πŸš€ Reconstruct 3D", variant="primary", size="lg")
246
 
247
  with gr.Row():
248
+ with gr.Column():
249
+ output_model = gr.Model3D(label="3D Preview")
250
+ with gr.Column():
251
+ output_file = gr.File(label="Download GLB")
252
 
253
  # Events
254
  segment_btn.click(
 
266
  reconstruct_btn.click(
267
  reconstruct_3d,
268
  inputs=[input_image, mask_state],
269
+ outputs=[output_model, status]
270
  )
271
+ output_model.change(lambda x: x, inputs=[output_model], outputs=[output_file])
272
 
273
  gr.Markdown("""
274
  ---