Spaces:
Sleeping
Sleeping
cyborgsuh commited on
Commit ·
f2f8993
1
Parent(s): 9634776
Examples uploaded
Browse files
app.py
CHANGED
|
@@ -3,6 +3,8 @@ import gradio as gr
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
def is_cat(x): return x[0].isupper()
|
| 5 |
|
|
|
|
|
|
|
| 6 |
categories=('dog','cat')
|
| 7 |
def resize_image(image):
|
| 8 |
# Resize the image to 192x192 pixels
|
|
@@ -19,7 +21,7 @@ def classify_image(img):
|
|
| 19 |
image=gr.Image(width=192,height=192)
|
| 20 |
label=gr.Label()
|
| 21 |
|
| 22 |
-
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label)
|
| 23 |
|
| 24 |
|
| 25 |
intf.launch(inline=False)
|
|
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
def is_cat(x): return x[0].isupper()
|
| 5 |
|
| 6 |
+
example=['dog.jpg','cat.jpg','cat_dog.jpg']
|
| 7 |
+
|
| 8 |
categories=('dog','cat')
|
| 9 |
def resize_image(image):
|
| 10 |
# Resize the image to 192x192 pixels
|
|
|
|
| 21 |
image=gr.Image(width=192,height=192)
|
| 22 |
label=gr.Label()
|
| 23 |
|
| 24 |
+
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=example)
|
| 25 |
|
| 26 |
|
| 27 |
intf.launch(inline=False)
|
cat.jpg
ADDED
|
cat_dog.jpg
ADDED
|
dog.jpg
ADDED
|