Spaces:
Running
Running
Create app.py
Browse files
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()
|