image_caption / app.py
TheKnight115's picture
Create app.py
09489a7 verified
raw
history blame
347 Bytes
from transformers import pipeline
import gradio as gr
pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
def genetreted_caption(images):
result= pipe(images)
return result[0]['generated_text']
interface= gr.Interface(genetreted_caption,inputs =gr.Image(type="pil"),outputs="text")
interface.launch(share=True)