Spaces:
Sleeping
Sleeping
| 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() | |