Nikhil Singh
commited on
Commit
•
de18024
1
Parent(s):
a93e8c7
minor changes
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ def is_cat(x): return 'cat' in x[0].isupper()
|
|
6 |
|
7 |
learn = load_learner('model.pkl')
|
8 |
|
9 |
-
categories = ['
|
10 |
|
11 |
def classify_image (img):
|
12 |
pred, idx, probs = learn.predict(img)
|
@@ -14,7 +14,7 @@ def classify_image (img):
|
|
14 |
|
15 |
image = gr.inputs.Image(shape=(224, 224))
|
16 |
label = gr.outputs.Label()
|
17 |
-
examples = [
|
18 |
|
19 |
-
intf = gr.Interface(classify_image, image, label, examples=examples)
|
20 |
-
intf.launch()
|
|
|
6 |
|
7 |
learn = load_learner('model.pkl')
|
8 |
|
9 |
+
categories = ['Cat', 'Dog']
|
10 |
|
11 |
def classify_image (img):
|
12 |
pred, idx, probs = learn.predict(img)
|
|
|
14 |
|
15 |
image = gr.inputs.Image(shape=(224, 224))
|
16 |
label = gr.outputs.Label()
|
17 |
+
examples = ["dog.jpg", "cat.jpg"]
|
18 |
|
19 |
+
intf = gr.Interface(fn=classify_image, inputs=image, output=label, examples=examples)
|
20 |
+
intf.launch(inline=False)
|