File size: 802 Bytes
ada2446
b28f796
 
ec44c4c
f45f2ba
b28f796
 
92679b1
b28f796
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
from transformers import pipeline

title = "Image Classifier"
description = "This machine has vision. It can identify objects and concepts in an image. To test the machine, upload or drop an image, submit and read the results. The results comprise a list of words that the machine sees in the image. Besides a word, the length of the bar indicates the confidence with which the machine sees the word. The longer the bar, the more confident the machine is."

pipe = pipeline(task="image-classification", 
                model="microsoft/beit-base-patch16-224-pt22k-ft22k")
gr.Interface.from_pipeline(pipe, 
                           title=title,
                           description=description,
                           enable_queue=True,
                           ).launch()