GenMatch / app.py
Parth1503's picture
Upload 3 files
9517f59 verified
import gradio as gr
from Clip import run_detection_pipeline
print("Loading the application...")
iface = gr.Interface(
fn=run_detection_pipeline,
inputs = [
gr.Image(type="pil", label="Upload Image"),
gr.Textbox(label="Text Prompt", placeholder="e.g., a photo of a dog's face")
],
outputs=[
gr.Textbox(label="Result"),
gr.Image(type="pil", label="Detection Result")
],
title="GenMatch: Open-Vocabulary Object Detector",
description="Upload an image and type what you want to find. The model will draw a box around it.",
# Adding examples makes your app much easier to test and demonstrate!
# Create a folder named 'examples' and put some images inside it.
# examples=[
# [r"C:\Users\sahas\OneDrive\Desktop\GenMatch\Bounding Box.png", "Object detected and highlighted."],
# [r"C:\Users\sahas\OneDrive\Desktop\GenMatch\Photo of a dog.jpg", "Could not find '{prompt}' with enough confidence."],
# ]
)
# Launch the app
if __name__ == "__main__":
iface.launch(debug=True)