SigLIP_Tagger / app.py
not-lain's picture
initial commit
009aa6f
raw
history blame
857 Bytes
import gradio as gr
from transformers import pipeline
pipeline = pipeline(
"image-classification", model="p1atdev/siglip-tagger-test-3", trust_remote_code=True
)
def predict(input_img):
predictions = pipeline(
input_img,
threshold=0.5, # optional parameter defaults to 0
return_scores=False, # optional parameter defaults to False
)
return predictions
description = """
image annotation pipeline using [`p1atdev/siglip-tagger-test-3`](https://huggingface.co/p1atdev/siglip-tagger-test-3) model **( β€’Μ€ Ο‰ ‒́ )y**
shoutout to [@p1atdev](https://huggingface.co/p1atdev) for his awesome work **~(=^β€₯^)γƒŽ**
"""
app = gr.Interface(
predict,
inputs=gr.Image(label="add your image here"),
outputs=gr.Text(label="tags"),
title="Image Annotator",
description=description,
)
app.launch()