rifatramadhani's picture
wip
b853b00
raw
history blame
739 Bytes
import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline
# pipe = pipeline("zero-shot-image-classification", model="google/siglip-base-patch16-256-multilingual")
# gr.load("models/wisdomik/QuiltNet-B-16").launch()
# gr.load("models/google/siglip-base-patch16-256-multilingual").launch()
# gr.Interface.from_pipeline(pipe).launch()
classifier = pipeline(model="google/siglip-so400m-patch14-384")
result = classifier(
"https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png",
candidate_labels=["animals", "humans", "landscape"],
)
print(result)
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()