File size: 631 Bytes
46d8015
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr 
from transformers import pipeline

pipe = pipeline("image-classification", "dima806/oxford_flowers_image_detection")

def classifier(image):
    return pipe(image)

gr.close_all()
demo = gr.Interface(fn=classifier,
                    inputs=[gr.Image(label="Upload image", type="pil")],
                    outputs=[gr.Textbox(label="Evaluation results")],
                    title="Flowers Classification MVP",
                    description="Classification flowers image based on Flower Datasets (https://www.robots.ox.ac.uk/~vgg/data/flowers/)",
                    allow_flagging="never")

demo.launch()