turtlegraphics's picture
fix image type
a04d80b verified
raw
history blame
670 Bytes
#
# Image Recognition with MobileNetv2
#
import gradio as gr
from transformers import pipeline
pipe = pipeline("image-to-text", model="microsoft/git-base")
def classify(image):
return pipe(image)
demo = gr.Interface(fn=classify, inputs=gr.Image(type="filepath", outputs="text", title="Image Captioning with git-base")
demo.launch()