Spaces:
Sleeping
Sleeping
File size: 342 Bytes
cb6a853 bfc42c8 cb6a853 bfc42c8 cb6a853 46b7ea5 cb6a853 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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()
|