umaradnaan's picture
Update app.py
cb6a853 verified
raw
history blame contribute delete
342 Bytes
import gradio as gr
from transformers import pipeline
captioner = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large")
def caption(image):
return captioner(image)[0]["generated_text"]
gr.Interface(
fn=caption,
inputs=gr.Image(type="pil"),
outputs="text",
title="Image Caption Generator"
).launch()