KangLiao commited on
Commit
b2242b9
·
1 Parent(s): a44d21a
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -262,7 +262,7 @@ def generate_image(prompt_scene,
262
  images = rearrange(images, 'b c h w -> b h w c')
263
  images = torch.clamp(127.5 * images + 128.0, 0, 255).to("cpu", dtype=torch.uint8).numpy()
264
  ret_images = [Image.fromarray(image) for image in images]
265
- return ret_images, output_reasoning
266
 
267
 
268
  # Gradio interface
@@ -382,7 +382,7 @@ with gr.Blocks(css=custom_css) as demo:
382
 
383
  image_output = gr.Gallery(label="Generated images", columns=4, rows=1)
384
 
385
- output_reasoning = gr.Textbox(label="Response")
386
 
387
  examples_t2i = gr.Examples(
388
  label="Prompt examples",
@@ -401,10 +401,21 @@ with gr.Blocks(css=custom_css) as demo:
401
  gr.Markdown(value="## Camera Understanding")
402
  image_input = gr.Image()
403
 
404
- with gr.Accordion("Settings", open=True):
405
- with gr.Row():
406
- thinking_und = gr.Checkbox(label="Thinking", value=False)
407
- und_seed_input = gr.Number(label="Seed (Optional)", precision=0, value=42)
 
 
 
 
 
 
 
 
 
 
 
408
 
409
  understanding_button = gr.Button("Chat")
410
  understanding_output = gr.Textbox(label="Response")
 
262
  images = rearrange(images, 'b c h w -> b h w c')
263
  images = torch.clamp(127.5 * images + 128.0, 0, 255).to("cpu", dtype=torch.uint8).numpy()
264
  ret_images = [Image.fromarray(image) for image in images]
265
+ return ret_images, output_reasoning[0]
266
 
267
 
268
  # Gradio interface
 
382
 
383
  image_output = gr.Gallery(label="Generated images", columns=4, rows=1)
384
 
385
+ output_reasoning = gr.Textbox(label="Thinking Process")
386
 
387
  examples_t2i = gr.Examples(
388
  label="Prompt examples",
 
401
  gr.Markdown(value="## Camera Understanding")
402
  image_input = gr.Image()
403
 
404
+ with gr.Accordion("Settings", open=True):
405
+ with gr.Row(equal_height=True):
406
+ thinking_und = gr.Radio(
407
+ ["Thinking"],
408
+ label=None,
409
+ value=None,
410
+ show_label=False,
411
+ interactive=True
412
+ )
413
+
414
+ seed_input = gr.Number(
415
+ label="Seed (Optional)",
416
+ precision=0,
417
+ value=42
418
+ )
419
 
420
  understanding_button = gr.Button("Chat")
421
  understanding_output = gr.Textbox(label="Response")