rowel commited on
Commit
973ded5
1 Parent(s): 634a5b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- vision_classifier = pipeline(task="image-classification",
5
- model="microsoft/beit-base-patch16-224-pt22k-ft22k")
6
- iface = gr.Interface.from_pipeline(vision_classifier,
7
- title="2-line Object Recognition using HF Pipeline",
8
- description="Demonstrates how to use HF pipeline and gradio.",
9
- examples=['data/wonder_cat.jpg', 'data/aki_dog.jpg',],
10
- article = "Author: <a href=\"https://huggingface.co/rowel\">Rowel Atienza</a>",
11
- ).launch()
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ pipe = pipeline(task="image-classification",
5
+ # model that can do 22k-category classification
6
+ model="microsoft/beit-base-patch16-224-pt22k-ft22k")
7
+ gr.Interface.from_pipeline(pipe,
8
+ title="22k Image Classification",
9
+ description="Object Recognition using Microsoft BEIT (22k classes)",
10
+ examples = ['wonder_cat.jpg', 'aki_dog.jpg',],
11
+ ).launch()