Spaces:
Sleeping
Sleeping
# | |
# Image Recognition with MobileNetv2 | |
# | |
import gradio as gr | |
from transformers import pipeline | |
pipe = pipeline("image-to-text", model="microsoft/git-base") | |
def classify(image): | |
output = pipe(image) | |
# example: [{'generated_text': 'front wheels of a truck'}] | |
return output[0]['generated_text'] | |
demo = gr.Interface(fn=classify, inputs=gr.Image(type="filepath"), outputs="text", title="Image Captioning with git-base") | |
demo.launch() |