Spaces:
Sleeping
Sleeping
Commit
·
7e42160
1
Parent(s):
60da1f7
[Updated] nb to final script
Browse files
.ipynb_checkpoints/Bearify_nb-checkpoint.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
Bearify_nb.ipynb
CHANGED
@@ -83,6 +83,7 @@
|
|
83 |
},
|
84 |
"outputs": [],
|
85 |
"source": [
|
|
|
86 |
"learn = load_learner('bear_model.pkl')"
|
87 |
]
|
88 |
},
|
@@ -158,6 +159,7 @@
|
|
158 |
},
|
159 |
"outputs": [],
|
160 |
"source": [
|
|
|
161 |
"categories = ('Black', 'Grizzly', 'Teddy')\n",
|
162 |
"\n",
|
163 |
"def classify_image(img):\n",
|
@@ -299,6 +301,7 @@
|
|
299 |
}
|
300 |
],
|
301 |
"source": [
|
|
|
302 |
"image = gr.Image()\n",
|
303 |
"labels = gr.Label()\n",
|
304 |
"examples = ['Images/teddy.jpg', 'Images/grizzly.jpg', 'Images/black.jpeg']\n",
|
@@ -308,11 +311,41 @@
|
|
308 |
]
|
309 |
},
|
310 |
{
|
311 |
-
"cell_type": "
|
312 |
-
"execution_count": null,
|
313 |
"metadata": {
|
314 |
"id": "bqK_vxTfpqBj"
|
315 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
"outputs": [],
|
317 |
"source": []
|
318 |
}
|
|
|
83 |
},
|
84 |
"outputs": [],
|
85 |
"source": [
|
86 |
+
"#|export\n",
|
87 |
"learn = load_learner('bear_model.pkl')"
|
88 |
]
|
89 |
},
|
|
|
159 |
},
|
160 |
"outputs": [],
|
161 |
"source": [
|
162 |
+
"#|export\n",
|
163 |
"categories = ('Black', 'Grizzly', 'Teddy')\n",
|
164 |
"\n",
|
165 |
"def classify_image(img):\n",
|
|
|
301 |
}
|
302 |
],
|
303 |
"source": [
|
304 |
+
"#|export\n",
|
305 |
"image = gr.Image()\n",
|
306 |
"labels = gr.Label()\n",
|
307 |
"examples = ['Images/teddy.jpg', 'Images/grizzly.jpg', 'Images/black.jpeg']\n",
|
|
|
311 |
]
|
312 |
},
|
313 |
{
|
314 |
+
"cell_type": "markdown",
|
|
|
315 |
"metadata": {
|
316 |
"id": "bqK_vxTfpqBj"
|
317 |
},
|
318 |
+
"source": [
|
319 |
+
"## Export"
|
320 |
+
]
|
321 |
+
},
|
322 |
+
{
|
323 |
+
"cell_type": "code",
|
324 |
+
"execution_count": 32,
|
325 |
+
"metadata": {},
|
326 |
+
"outputs": [
|
327 |
+
{
|
328 |
+
"ename": "ImportError",
|
329 |
+
"evalue": "cannot import name 'notebook2script' from 'nbdev.export' (C:\\Users\\utkar\\prod_apps\\Bearify\\bear_env\\lib\\site-packages\\nbdev\\export.py)",
|
330 |
+
"output_type": "error",
|
331 |
+
"traceback": [
|
332 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
333 |
+
"\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
|
334 |
+
"Cell \u001b[1;32mIn[32], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnbdev\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexport\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m notebook2script\n",
|
335 |
+
"\u001b[1;31mImportError\u001b[0m: cannot import name 'notebook2script' from 'nbdev.export' (C:\\Users\\utkar\\prod_apps\\Bearify\\bear_env\\lib\\site-packages\\nbdev\\export.py)"
|
336 |
+
]
|
337 |
+
}
|
338 |
+
],
|
339 |
+
"source": [
|
340 |
+
"import nbdev\n",
|
341 |
+
"nbdev.export.nb_export('Bearify.ipynb', 'app')\n",
|
342 |
+
"print('Export successful')"
|
343 |
+
]
|
344 |
+
},
|
345 |
+
{
|
346 |
+
"cell_type": "code",
|
347 |
+
"execution_count": null,
|
348 |
+
"metadata": {},
|
349 |
"outputs": [],
|
350 |
"source": []
|
351 |
}
|