Spaces:
Runtime error
Runtime error
updated app.py for gradio v4
Browse files- app - original.py +16 -0
- app.py +5 -5
app - original.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
examples = [
|
4 |
+
'ladybug.jpg',
|
5 |
+
'revolver.jpg',
|
6 |
+
'automotive.jpg',
|
7 |
+
'frog01.jpg',
|
8 |
+
'eagle.jpg'
|
9 |
+
]
|
10 |
+
|
11 |
+
# image = gr.inputs.Image(source='webcam', shape=(224,224))
|
12 |
+
|
13 |
+
gr.Interface.load(
|
14 |
+
"huggingface/google/vit-base-patch16-224",
|
15 |
+
# inputs=image,
|
16 |
+
examples=examples).launch()
|
app.py
CHANGED
@@ -8,9 +8,9 @@ examples = [
|
|
8 |
'eagle.jpg'
|
9 |
]
|
10 |
|
11 |
-
# image = gr.inputs.Image(source='webcam', shape=(224,224))
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
8 |
'eagle.jpg'
|
9 |
]
|
10 |
|
|
|
11 |
|
12 |
+
# works w/ gradio v4
|
13 |
+
|
14 |
+
demo = gr.load("google/vit-base-patch16-224", src="models", examples=examples)
|
15 |
+
|
16 |
+
demo.launch()
|