Spaces:
Sleeping
Sleeping
clean project directory
Browse files- app.ipynb +50 -33
- models/weights.pth +0 -3
app.ipynb
CHANGED
|
@@ -44,32 +44,6 @@
|
|
| 44 |
" item_tfms=Resize(192, method='squish'))"
|
| 45 |
]
|
| 46 |
},
|
| 47 |
-
{
|
| 48 |
-
"cell_type": "code",
|
| 49 |
-
"execution_count": null,
|
| 50 |
-
"id": "c107f724",
|
| 51 |
-
"metadata": {
|
| 52 |
-
"id": "c107f724",
|
| 53 |
-
"outputId": "9fff9f32-b206-4a2f-99cf-e12b8090da81"
|
| 54 |
-
},
|
| 55 |
-
"outputs": [
|
| 56 |
-
{
|
| 57 |
-
"data": {
|
| 58 |
-
"text/plain": [
|
| 59 |
-
"<fastai.learner.Learner at 0x34dfe60f0>"
|
| 60 |
-
]
|
| 61 |
-
},
|
| 62 |
-
"execution_count": 23,
|
| 63 |
-
"metadata": {},
|
| 64 |
-
"output_type": "execute_result"
|
| 65 |
-
}
|
| 66 |
-
],
|
| 67 |
-
"source": [
|
| 68 |
-
"# learn = vision_learner(dls, resnet18, metrics=error_rate)\n",
|
| 69 |
-
"# learn.load('weights')\n",
|
| 70 |
-
"# learn.fine_tune(3)"
|
| 71 |
-
]
|
| 72 |
-
},
|
| 73 |
{
|
| 74 |
"cell_type": "code",
|
| 75 |
"execution_count": 31,
|
|
@@ -223,6 +197,7 @@
|
|
| 223 |
}
|
| 224 |
],
|
| 225 |
"source": [
|
|
|
|
| 226 |
"# learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\n",
|
| 227 |
"# learn.fine_tune(3)"
|
| 228 |
]
|
|
@@ -236,9 +211,8 @@
|
|
| 236 |
},
|
| 237 |
"outputs": [],
|
| 238 |
"source": [
|
| 239 |
-
"#
|
| 240 |
-
"# learn.export('model.pkl')
|
| 241 |
-
"# learn.save('weights')"
|
| 242 |
]
|
| 243 |
},
|
| 244 |
{
|
|
@@ -370,7 +344,7 @@
|
|
| 370 |
},
|
| 371 |
{
|
| 372 |
"cell_type": "code",
|
| 373 |
-
"execution_count":
|
| 374 |
"id": "0518a30a",
|
| 375 |
"metadata": {
|
| 376 |
"id": "0518a30a",
|
|
@@ -381,8 +355,31 @@
|
|
| 381 |
"name": "stdout",
|
| 382 |
"output_type": "stream",
|
| 383 |
"text": [
|
| 384 |
-
"* Running on local URL: http://127.0.0.1:7861\n"
|
|
|
|
|
|
|
|
|
|
| 385 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
}
|
| 387 |
],
|
| 388 |
"source": [
|
|
@@ -400,7 +397,7 @@
|
|
| 400 |
},
|
| 401 |
{
|
| 402 |
"cell_type": "code",
|
| 403 |
-
"execution_count":
|
| 404 |
"id": "0d1e90ce",
|
| 405 |
"metadata": {
|
| 406 |
"id": "0d1e90ce"
|
|
@@ -412,7 +409,7 @@
|
|
| 412 |
},
|
| 413 |
{
|
| 414 |
"cell_type": "code",
|
| 415 |
-
"execution_count":
|
| 416 |
"id": "82774c08",
|
| 417 |
"metadata": {
|
| 418 |
"id": "82774c08"
|
|
@@ -424,6 +421,26 @@
|
|
| 424 |
"text": [
|
| 425 |
"Export successful\n"
|
| 426 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
}
|
| 428 |
],
|
| 429 |
"source": [
|
|
|
|
| 44 |
" item_tfms=Resize(192, method='squish'))"
|
| 45 |
]
|
| 46 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
{
|
| 48 |
"cell_type": "code",
|
| 49 |
"execution_count": 31,
|
|
|
|
| 197 |
}
|
| 198 |
],
|
| 199 |
"source": [
|
| 200 |
+
"# train learner\n",
|
| 201 |
"# learn = vision_learner(dls, resnet18, metrics=error_rate).to_fp16()\n",
|
| 202 |
"# learn.fine_tune(3)"
|
| 203 |
]
|
|
|
|
| 211 |
},
|
| 212 |
"outputs": [],
|
| 213 |
"source": [
|
| 214 |
+
"# export learner to load into app\n",
|
| 215 |
+
"# learn.export('model.pkl')"
|
|
|
|
| 216 |
]
|
| 217 |
},
|
| 218 |
{
|
|
|
|
| 344 |
},
|
| 345 |
{
|
| 346 |
"cell_type": "code",
|
| 347 |
+
"execution_count": 37,
|
| 348 |
"id": "0518a30a",
|
| 349 |
"metadata": {
|
| 350 |
"id": "0518a30a",
|
|
|
|
| 355 |
"name": "stdout",
|
| 356 |
"output_type": "stream",
|
| 357 |
"text": [
|
| 358 |
+
"* Running on local URL: http://127.0.0.1:7861\n",
|
| 359 |
+
"* Running on public URL: https://c9cc1410b9511ce701.gradio.live\n",
|
| 360 |
+
"\n",
|
| 361 |
+
"This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n"
|
| 362 |
]
|
| 363 |
+
},
|
| 364 |
+
{
|
| 365 |
+
"data": {
|
| 366 |
+
"text/html": [
|
| 367 |
+
"<div><iframe src=\"https://c9cc1410b9511ce701.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
| 368 |
+
],
|
| 369 |
+
"text/plain": [
|
| 370 |
+
"<IPython.core.display.HTML object>"
|
| 371 |
+
]
|
| 372 |
+
},
|
| 373 |
+
"metadata": {},
|
| 374 |
+
"output_type": "display_data"
|
| 375 |
+
},
|
| 376 |
+
{
|
| 377 |
+
"data": {
|
| 378 |
+
"text/plain": []
|
| 379 |
+
},
|
| 380 |
+
"execution_count": 37,
|
| 381 |
+
"metadata": {},
|
| 382 |
+
"output_type": "execute_result"
|
| 383 |
}
|
| 384 |
],
|
| 385 |
"source": [
|
|
|
|
| 397 |
},
|
| 398 |
{
|
| 399 |
"cell_type": "code",
|
| 400 |
+
"execution_count": 38,
|
| 401 |
"id": "0d1e90ce",
|
| 402 |
"metadata": {
|
| 403 |
"id": "0d1e90ce"
|
|
|
|
| 409 |
},
|
| 410 |
{
|
| 411 |
"cell_type": "code",
|
| 412 |
+
"execution_count": 39,
|
| 413 |
"id": "82774c08",
|
| 414 |
"metadata": {
|
| 415 |
"id": "82774c08"
|
|
|
|
| 421 |
"text": [
|
| 422 |
"Export successful\n"
|
| 423 |
]
|
| 424 |
+
},
|
| 425 |
+
{
|
| 426 |
+
"data": {
|
| 427 |
+
"text/html": [],
|
| 428 |
+
"text/plain": [
|
| 429 |
+
"<IPython.core.display.HTML object>"
|
| 430 |
+
]
|
| 431 |
+
},
|
| 432 |
+
"metadata": {},
|
| 433 |
+
"output_type": "display_data"
|
| 434 |
+
},
|
| 435 |
+
{
|
| 436 |
+
"data": {
|
| 437 |
+
"text/html": [],
|
| 438 |
+
"text/plain": [
|
| 439 |
+
"<IPython.core.display.HTML object>"
|
| 440 |
+
]
|
| 441 |
+
},
|
| 442 |
+
"metadata": {},
|
| 443 |
+
"output_type": "display_data"
|
| 444 |
}
|
| 445 |
],
|
| 446 |
"source": [
|
models/weights.pth
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0a978c050fd8de68a88c58b90ca7cebf7c0c4fc40fd82304a6f9a49a7c085633
|
| 3 |
-
size 140592546
|
|
|
|
|
|
|
|
|
|
|
|