File size: 676 Bytes
f3004ad
adf5040
a0761cf
adf5040
 
7e76bff
 
 
 
adf5040
 
 
 
 
 
7e76bff
 
 
63d8dec
 
 
adf5040
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from gradio_image_prompter import ImagePrompter

# Define the Gradio interface
demo = gr.Interface(
    fn=lambda prompts: (
        prompts["image"],
        prompts["points"],
    ),  # Extract image and points from the ImagePrompter
    inputs=ImagePrompter(
        show_label=False
    ),  # ImagePrompter for image input and point selection
    outputs=[
        gr.Image(show_label=False),
        gr.Dataframe(label="Points"),
    ],  # Outputs: Image and DataFrame of points
    title="Image Point Collector",
    description="Upload an image, click on it, and get the coordinates of the clicked points.",
)

# Launch the Gradio app
demo.launch()