manoh2f2 commited on
Commit
6bb0de0
1 Parent(s): bfa5aa7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import gradio as gr
 
2
 
3
- model = gr.load("models/manoh2f2/finetuned-vit-flowers")
4
  images = ["images/daisy.jpg", "images/dandelion.jpg", "images/rosa.jpg", "images/sunflower.jpg", "images/tulip.jpg"]
5
 
6
- iface = gr.Interface(
7
- model,
8
- inputs = gr.Image(label="Upload Image"),
9
- outputs = gr.Textbox(),
10
  examples= [ [example] for example in images],
11
  description="Daisy, Dandelion, Rose, Sonflower, Tulip",
12
  title="FLower Classifier - Vit"
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ pipe = pipeline("image-classification", model="manoh2f2/finetuned-vit-flowers")
5
  images = ["images/daisy.jpg", "images/dandelion.jpg", "images/rosa.jpg", "images/sunflower.jpg", "images/tulip.jpg"]
6
 
7
+ iface = gr.Interface.from_pipeline(
8
+ pipe,
 
 
9
  examples= [ [example] for example in images],
10
  description="Daisy, Dandelion, Rose, Sonflower, Tulip",
11
  title="FLower Classifier - Vit"