ariG23498 HF staff commited on
Commit
599cf8a
·
verified ·
1 Parent(s): f723021

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline(
5
+ "image-classification",
6
+ model="ariG23498/vit_base_patch16_224.orig_in21k_ft_in1k.ft_food101"
7
+ )
8
+
9
+ def classify(image):
10
+ return pipe(image)[0]["label"]
11
+
12
+ demo = gr.Interface(fn=classify, inputs=gr.Image(type="pil"), outputs="text")
13
+ demo.launch()