blip-api / app.py
spuun's picture
Update app.py
0d2df58
raw
history blame contribute delete
305 Bytes
import gradio as gr
from transformers import pipeline
model_id = "Salesforce/blip-image-captioning-large"
captioner = pipeline(model=model_id)
def launch(input):
return captioner(input)[0]["generated_text"]
iface = gr.Interface(fn=launch, inputs=gr.Image(type="pil"), outputs="text")
iface.launch()