Home

Awesome

Image Prompter for Gradio

A gradio component to upload images and process point/box prompts.

This custom component is developed for Tokenize Anything gradio demo.

Installation

Preliminaries

gradio >= 4.0.0

Installing Package

pip install gradio-image-prompter

Quick Start

Development

cd gradio-image-prompter
gradio cc install
gradio cc dev

Example

import gradio as gr
from gradio_image_prompter import ImagePrompter

demo = gr.Interface(
    lambda prompts: (prompts["image"], prompts["points"]),
    ImagePrompter(show_label=False),
    [gr.Image(show_label=False), gr.Dataframe(label="Points")],
)
demo.launch()

License

Apache License 2.0

Acknowledgement

We thank the repositories: SAM, GradioBox and Gradio.