import gradio as gr
from gradio_image_prompter import ImagePrompter
def format_points_output(points):
point_html = "
[
"
for point in points:
point_html += f" {point},
"
point_html += "]
"
return point_html
def show(prompts):
points = [[int(point[0]), int(point[1])] for point in prompts["points"]]
return (format_points_output(points),)
demo = gr.Interface(
show,
ImagePrompter(show_label=False),
[gr.HTML(label="Points")],
)
demo.launch()