Peter Kibuchi commited on
Commit
93712b8
1 Parent(s): b0b5d60

Import timm

Browse files
Files changed (2) hide show
  1. app.ipynb +2 -38
  2. app.py +3 -2
app.ipynb CHANGED
@@ -17,7 +17,8 @@
17
  "source": [
18
  "#|export\n",
19
  "from fastai.vision.all import *\n",
20
- "import gradio as gr"
 
21
  ]
22
  },
23
  {
@@ -66,43 +67,6 @@
66
  "execution_count": 5,
67
  "metadata": {},
68
  "output_type": "execute_result"
69
- },
70
- {
71
- "data": {
72
- "text/html": [
73
- "\n",
74
- "<style>\n",
75
- " /* Turns off some styling */\n",
76
- " progress {\n",
77
- " /* gets rid of default border in Firefox and Opera. */\n",
78
- " border: none;\n",
79
- " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
80
- " background-size: auto;\n",
81
- " }\n",
82
- " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
83
- " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
84
- " }\n",
85
- " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
86
- " background: #F44336;\n",
87
- " }\n",
88
- "</style>\n"
89
- ],
90
- "text/plain": [
91
- "<IPython.core.display.HTML object>"
92
- ]
93
- },
94
- "metadata": {},
95
- "output_type": "display_data"
96
- },
97
- {
98
- "data": {
99
- "text/html": [],
100
- "text/plain": [
101
- "<IPython.core.display.HTML object>"
102
- ]
103
- },
104
- "metadata": {},
105
- "output_type": "display_data"
106
  }
107
  ],
108
  "source": [
 
17
  "source": [
18
  "#|export\n",
19
  "from fastai.vision.all import *\n",
20
+ "import gradio as gr\n",
21
+ "import timm"
22
  ]
23
  },
24
  {
 
67
  "execution_count": 5,
68
  "metadata": {},
69
  "output_type": "execute_result"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
71
  ],
72
  "source": [
app.py CHANGED
@@ -6,6 +6,7 @@ __all__ = ['learn', 'categories', 'image', 'label', 'path', 'examples', 'intf',
6
  # %% ../app.ipynb 1
7
  from fastai.vision.all import *
8
  import gradio as gr
 
9
 
10
  # %% ../app.ipynb 2
11
  learn = load_learner("model.pkl")
@@ -21,8 +22,8 @@ def classify_img(img):
21
  # %% ../app.ipynb 4
22
  from pathlib import Path
23
 
24
- image = gr.inputs.Image(shape=(192, 192))
25
- label = gr.outputs.Label()
26
 
27
  path = Path("examples")
28
  examples = [file for file in path.iterdir()]
 
6
  # %% ../app.ipynb 1
7
  from fastai.vision.all import *
8
  import gradio as gr
9
+ import timm
10
 
11
  # %% ../app.ipynb 2
12
  learn = load_learner("model.pkl")
 
22
  # %% ../app.ipynb 4
23
  from pathlib import Path
24
 
25
+ image = gr.Image(shape=(192, 192))
26
+ label = gr.Label()
27
 
28
  path = Path("examples")
29
  examples = [file for file in path.iterdir()]