Spaces:
Sleeping
Sleeping
Add image examples and update requirements
Browse files- app.py +6 -2
- cristiano.jpg β images/cristiano.jpg +0 -0
- messi.jpg β images/messi.jpg +0 -0
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
|
|
3 |
|
4 |
|
5 |
categories = ("Cristiano Ronaldo", "Lionel Messi")
|
@@ -12,10 +13,13 @@ def classify_image(img):
|
|
12 |
|
13 |
# image = gr.Image(shape=(192, 192))
|
14 |
# label = gr.outputs.Label()
|
15 |
-
examples = ['cristiano.jpg', 'messi.jpg']
|
16 |
|
17 |
intf = gr.Interface(
|
18 |
classify_image, gr.Image(type="pil"),
|
19 |
-
"image",
|
|
|
|
|
|
|
20 |
intf.launch(inline=False)
|
21 |
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
+
import os
|
4 |
|
5 |
|
6 |
categories = ("Cristiano Ronaldo", "Lionel Messi")
|
|
|
13 |
|
14 |
# image = gr.Image(shape=(192, 192))
|
15 |
# label = gr.outputs.Label()
|
16 |
+
examples = ['cristiano.jpg', 'messi.jpg', './images/cristiano.jpg', './images/messi.jpg']
|
17 |
|
18 |
intf = gr.Interface(
|
19 |
classify_image, gr.Image(type="pil"),
|
20 |
+
"image",
|
21 |
+
examples=[
|
22 |
+
os.path.join("images/cristiano.jpg"),
|
23 |
+
os.path.join("images/messi.jpg")])
|
24 |
intf.launch(inline=False)
|
25 |
|
cristiano.jpg β images/cristiano.jpg
RENAMED
File without changes
|
messi.jpg β images/messi.jpg
RENAMED
File without changes
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
fastai
|
2 |
-
fastbook
|
|
|
|
1 |
fastai
|
2 |
+
fastbook
|
3 |
+
gradio
|