CasonMizu commited on
Commit
040a05b
1 Parent(s): f5a921b

New app python file

Browse files
Files changed (3) hide show
  1. app.ipynb +27 -19
  2. app.py +8 -1
  3. app/app.py +8 -1
app.ipynb CHANGED
@@ -9,11 +9,12 @@
9
  },
10
  {
11
  "cell_type": "code",
12
- "execution_count": 26,
13
  "metadata": {},
14
  "outputs": [],
15
  "source": [
16
  "#|default_exp app\n",
 
17
  "# creating a python image library from the image\n",
18
  "from fastai.vision.all import *\n",
19
  "import gradio as gr\n",
@@ -23,7 +24,7 @@
23
  },
24
  {
25
  "cell_type": "code",
26
- "execution_count": 27,
27
  "metadata": {},
28
  "outputs": [
29
  {
@@ -34,7 +35,7 @@
34
  "PILImage mode=RGB size=144x192"
35
  ]
36
  },
37
- "execution_count": 27,
38
  "metadata": {},
39
  "output_type": "execute_result"
40
  }
@@ -48,7 +49,7 @@
48
  },
49
  {
50
  "cell_type": "code",
51
- "execution_count": 28,
52
  "metadata": {},
53
  "outputs": [],
54
  "source": [
@@ -63,7 +64,7 @@
63
  },
64
  {
65
  "cell_type": "code",
66
- "execution_count": 29,
67
  "metadata": {},
68
  "outputs": [
69
  {
@@ -95,7 +96,14 @@
95
  },
96
  {
97
  "data": {
98
- "text/html": [],
 
 
 
 
 
 
 
99
  "text/plain": [
100
  "<IPython.core.display.HTML object>"
101
  ]
@@ -109,7 +117,7 @@
109
  "('False', tensor(0), tensor([0.9858, 0.0142]))"
110
  ]
111
  },
112
- "execution_count": 29,
113
  "metadata": {},
114
  "output_type": "execute_result"
115
  }
@@ -120,7 +128,7 @@
120
  },
121
  {
122
  "cell_type": "code",
123
- "execution_count": 30,
124
  "metadata": {},
125
  "outputs": [],
126
  "source": [
@@ -134,7 +142,7 @@
134
  },
135
  {
136
  "cell_type": "code",
137
- "execution_count": 31,
138
  "metadata": {},
139
  "outputs": [
140
  {
@@ -180,7 +188,7 @@
180
  "{'Dog': 0.9858279228210449, 'Cat': 0.01417205948382616}"
181
  ]
182
  },
183
- "execution_count": 31,
184
  "metadata": {},
185
  "output_type": "execute_result"
186
  }
@@ -191,15 +199,15 @@
191
  },
192
  {
193
  "cell_type": "code",
194
- "execution_count": 32,
195
  "metadata": {},
196
  "outputs": [
197
  {
198
  "name": "stdout",
199
  "output_type": "stream",
200
  "text": [
201
- "Running on local URL: http://127.0.0.1:7862\n",
202
- "Running on public URL: https://862bc0924638e8101b.gradio.live\n",
203
  "\n",
204
  "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
205
  ]
@@ -208,7 +216,7 @@
208
  "data": {
209
  "text/plain": []
210
  },
211
- "execution_count": 32,
212
  "metadata": {},
213
  "output_type": "execute_result"
214
  }
@@ -226,7 +234,7 @@
226
  },
227
  {
228
  "cell_type": "code",
229
- "execution_count": 33,
230
  "metadata": {},
231
  "outputs": [],
232
  "source": [
@@ -235,7 +243,7 @@
235
  },
236
  {
237
  "cell_type": "code",
238
- "execution_count": 34,
239
  "metadata": {},
240
  "outputs": [],
241
  "source": [
@@ -244,7 +252,7 @@
244
  },
245
  {
246
  "cell_type": "code",
247
- "execution_count": 35,
248
  "metadata": {},
249
  "outputs": [
250
  {
@@ -267,7 +275,7 @@
267
  " requires_grad=True)"
268
  ]
269
  },
270
- "execution_count": 35,
271
  "metadata": {},
272
  "output_type": "execute_result"
273
  }
@@ -285,7 +293,7 @@
285
  },
286
  {
287
  "cell_type": "code",
288
- "execution_count": 36,
289
  "metadata": {},
290
  "outputs": [
291
  {
 
9
  },
10
  {
11
  "cell_type": "code",
12
+ "execution_count": 1,
13
  "metadata": {},
14
  "outputs": [],
15
  "source": [
16
  "#|default_exp app\n",
17
+ "#|export\n",
18
  "# creating a python image library from the image\n",
19
  "from fastai.vision.all import *\n",
20
  "import gradio as gr\n",
 
24
  },
25
  {
26
  "cell_type": "code",
27
+ "execution_count": 2,
28
  "metadata": {},
29
  "outputs": [
30
  {
 
35
  "PILImage mode=RGB size=144x192"
36
  ]
37
  },
38
+ "execution_count": 2,
39
  "metadata": {},
40
  "output_type": "execute_result"
41
  }
 
49
  },
50
  {
51
  "cell_type": "code",
52
+ "execution_count": 3,
53
  "metadata": {},
54
  "outputs": [],
55
  "source": [
 
64
  },
65
  {
66
  "cell_type": "code",
67
+ "execution_count": 4,
68
  "metadata": {},
69
  "outputs": [
70
  {
 
96
  },
97
  {
98
  "data": {
99
+ "text/html": [
100
+ "\n",
101
+ " <div>\n",
102
+ " <progress value='0' class='' max='1' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
103
+ " 0.00% [0/1 00:00&lt;?]\n",
104
+ " </div>\n",
105
+ " "
106
+ ],
107
  "text/plain": [
108
  "<IPython.core.display.HTML object>"
109
  ]
 
117
  "('False', tensor(0), tensor([0.9858, 0.0142]))"
118
  ]
119
  },
120
+ "execution_count": 4,
121
  "metadata": {},
122
  "output_type": "execute_result"
123
  }
 
128
  },
129
  {
130
  "cell_type": "code",
131
+ "execution_count": 5,
132
  "metadata": {},
133
  "outputs": [],
134
  "source": [
 
142
  },
143
  {
144
  "cell_type": "code",
145
+ "execution_count": 6,
146
  "metadata": {},
147
  "outputs": [
148
  {
 
188
  "{'Dog': 0.9858279228210449, 'Cat': 0.01417205948382616}"
189
  ]
190
  },
191
+ "execution_count": 6,
192
  "metadata": {},
193
  "output_type": "execute_result"
194
  }
 
199
  },
200
  {
201
  "cell_type": "code",
202
+ "execution_count": 7,
203
  "metadata": {},
204
  "outputs": [
205
  {
206
  "name": "stdout",
207
  "output_type": "stream",
208
  "text": [
209
+ "Running on local URL: http://127.0.0.1:7863\n",
210
+ "Running on public URL: https://1647e7c41df1918aa8.gradio.live\n",
211
  "\n",
212
  "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
213
  ]
 
216
  "data": {
217
  "text/plain": []
218
  },
219
+ "execution_count": 7,
220
  "metadata": {},
221
  "output_type": "execute_result"
222
  }
 
234
  },
235
  {
236
  "cell_type": "code",
237
+ "execution_count": 8,
238
  "metadata": {},
239
  "outputs": [],
240
  "source": [
 
243
  },
244
  {
245
  "cell_type": "code",
246
+ "execution_count": 9,
247
  "metadata": {},
248
  "outputs": [],
249
  "source": [
 
252
  },
253
  {
254
  "cell_type": "code",
255
+ "execution_count": 10,
256
  "metadata": {},
257
  "outputs": [
258
  {
 
275
  " requires_grad=True)"
276
  ]
277
  },
278
+ "execution_count": 10,
279
  "metadata": {},
280
  "output_type": "execute_result"
281
  }
 
293
  },
294
  {
295
  "cell_type": "code",
296
+ "execution_count": 11,
297
  "metadata": {},
298
  "outputs": [
299
  {
app.py CHANGED
@@ -1,7 +1,14 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['im', 'temp', 'learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
 
 
 
 
 
 
 
5
 
6
  # %% ../app.ipynb 2
7
  im = PILImage.create('dog.jpeg')
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['im', 'temp', 'learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
5
+
6
+ # %% ../app.ipynb 1
7
+ # creating a python image library from the image
8
+ from fastai.vision.all import *
9
+ import gradio as gr
10
+
11
+ def is_cat(x): return x[0].isupper()
12
 
13
  # %% ../app.ipynb 2
14
  im = PILImage.create('dog.jpeg')
app/app.py CHANGED
@@ -1,7 +1,14 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['im', 'temp', 'learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
 
 
 
 
 
 
 
5
 
6
  # %% ../app.ipynb 2
7
  im = PILImage.create('dog.jpeg')
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['im', 'temp', 'learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
5
+
6
+ # %% ../app.ipynb 1
7
+ # creating a python image library from the image
8
+ from fastai.vision.all import *
9
+ import gradio as gr
10
+
11
+ def is_cat(x): return x[0].isupper()
12
 
13
  # %% ../app.ipynb 2
14
  im = PILImage.create('dog.jpeg')