1
import gradio as gr
from PIL import Image

def text(img):
    return None, None, None, 'Test'

demo = gr.Interface(fn=text, 
            inputs=gr.Image(type="pil"),
            examples=["rock.jpg", "rock2.jpg"],
            outputs=[gr.Image(),
                     gr.Label(num_top_classes=3), 
                     gr.Label(num_top_classes=3),
                     gr.Textbox()],
             title = "Test", 
             description= "Test",
             theme=gr.themes.Monochrome())

demo.launch()   

The page looks like this enter image description here

Yet, I would like to move up the example block and put it right below the input text field block. This is the doc https://gradio.app/docs/#interface but I am not sure if I should use gr.Block() to customize because the interface provides everything I need except put the example block.

test tes
  • 121
  • 6

1 Answers1

0

You should try to use the Block method instead. You can find it here. It's very easy to do what you want if you use this method's components.

cylegend
  • 163
  • 1
  • 2
  • 12