daniyal214's picture
Update app.py
e904b51
raw
history blame
372 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("image-to-text", model="daniyal214/finetuned-blip-chest-xrays")
def get_captions(image):
result = pipe(image)
result = result[0]['generated_text']
return result
iface = gr.Interface(fn = get_captions, inputs = "image", outputs = ['text'], title="X-rays Image Caption Generator")
iface.launch()