import gradio as gr
from demo import query_image
description = """
Gradio demo for combining Segment-Anything (SAM)
OWL-ViT.
\n\nYou can use OWL-ViT to query boxes with text descriptions of any object, then SAM will segment anything in the boxes.
"""
demo = gr.Interface(
query_image,
inputs=[gr.Image(), "text"],
outputs=["image", "image"],
title="Segment Anything (SAM) with OWL-ViT",
description=description,
examples=[
["./demo_images/cats.png", "cats,ears"],
["./demo_images/demo1.jpg", "bear,soil,sea"],
["./demo_images/demo2.jpg", "dog,ear,leg,eyes,tail"],
["./demo_images/tanager.jpg", "wing,eyes,back,legs,tail"]
],
)
# demo.launch()
demo.launch(server_name="0.0.0.0", debug=True)