Add application file
Browse files
app.py
CHANGED
@@ -3,12 +3,16 @@
|
|
3 |
# %% auto 0
|
4 |
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
|
5 |
|
6 |
-
# %% ../Untitled1.ipynb
|
7 |
!pip install -Uqq fastai
|
|
|
|
|
8 |
from fastai.vision.all import *
|
9 |
|
10 |
-
# %% ../Untitled1.ipynb
|
11 |
!pip install gradio
|
|
|
|
|
12 |
import gradio as gr
|
13 |
def is_cat(x): return x[0].isupper()
|
14 |
|
@@ -26,4 +30,4 @@ image = gr.inputs.Image(shape = (192,192))
|
|
26 |
label = gr.outputs.Label()
|
27 |
examples = ['cat.jpeg']
|
28 |
intf = gr.Interface(fn = classify_image,inputs = image,outputs = label,examples=examples)
|
29 |
-
intf.launch(inline =False)
|
|
|
3 |
# %% auto 0
|
4 |
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
|
5 |
|
6 |
+
# %% ../Untitled1.ipynb 2
|
7 |
!pip install -Uqq fastai
|
8 |
+
|
9 |
+
# %% ../Untitled1.ipynb 4
|
10 |
from fastai.vision.all import *
|
11 |
|
12 |
+
# %% ../Untitled1.ipynb 5
|
13 |
!pip install gradio
|
14 |
+
|
15 |
+
# %% ../Untitled1.ipynb 6
|
16 |
import gradio as gr
|
17 |
def is_cat(x): return x[0].isupper()
|
18 |
|
|
|
30 |
label = gr.outputs.Label()
|
31 |
examples = ['cat.jpeg']
|
32 |
intf = gr.Interface(fn = classify_image,inputs = image,outputs = label,examples=examples)
|
33 |
+
intf.launch(inline =False)
|