Spaces:
Sleeping
Sleeping
doantrang982@uni.minerva.edu
commited on
Commit
·
518c86d
1
Parent(s):
ec83357
remove redundant notebook
Browse files
.ipynb_checkpoints/training-checkpoint.ipynb
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"data": {
|
10 |
+
"text/html": [
|
11 |
+
"\n",
|
12 |
+
"<style>\n",
|
13 |
+
" /* Turns off some styling */\n",
|
14 |
+
" progress {\n",
|
15 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
16 |
+
" border: none;\n",
|
17 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
18 |
+
" background-size: auto;\n",
|
19 |
+
" }\n",
|
20 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
21 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
22 |
+
" }\n",
|
23 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
24 |
+
" background: #F44336;\n",
|
25 |
+
" }\n",
|
26 |
+
"</style>\n"
|
27 |
+
],
|
28 |
+
"text/plain": [
|
29 |
+
"<IPython.core.display.HTML object>"
|
30 |
+
]
|
31 |
+
},
|
32 |
+
"metadata": {},
|
33 |
+
"output_type": "display_data"
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"data": {
|
37 |
+
"text/html": [
|
38 |
+
"\n",
|
39 |
+
" <div>\n",
|
40 |
+
" <progress value='107094016' class='' max='811706944' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
41 |
+
" 13.19% [107094016/811706944 00:41<04:31]\n",
|
42 |
+
" </div>\n",
|
43 |
+
" "
|
44 |
+
],
|
45 |
+
"text/plain": [
|
46 |
+
"<IPython.core.display.HTML object>"
|
47 |
+
]
|
48 |
+
},
|
49 |
+
"metadata": {},
|
50 |
+
"output_type": "display_data"
|
51 |
+
}
|
52 |
+
],
|
53 |
+
"source": [
|
54 |
+
"from fastai.vision.all import *\n",
|
55 |
+
"path = untar_data(URLs.PETS)\n",
|
56 |
+
"dls = ImageDataLoaders.from_name_re(path, get_image_files(path/'images'), pat='(.+)_\\d+.jpg', item_tfms=Resize(460), batch_tfms=aug_transforms(size=224, min_scale=0.75))\n",
|
57 |
+
"learn = vision_learner(dls, models.resnet50, metrics=accuracy)\n",
|
58 |
+
"learn.fine_tune(1)\n",
|
59 |
+
"learn.path = Path('.')\n",
|
60 |
+
"learn.export()"
|
61 |
+
]
|
62 |
+
},
|
63 |
+
{
|
64 |
+
"cell_type": "code",
|
65 |
+
"execution_count": null,
|
66 |
+
"metadata": {},
|
67 |
+
"outputs": [],
|
68 |
+
"source": []
|
69 |
+
}
|
70 |
+
],
|
71 |
+
"metadata": {
|
72 |
+
"kernelspec": {
|
73 |
+
"display_name": "Python 3 (ipykernel)",
|
74 |
+
"language": "python",
|
75 |
+
"name": "python3"
|
76 |
+
},
|
77 |
+
"language_info": {
|
78 |
+
"codemirror_mode": {
|
79 |
+
"name": "ipython",
|
80 |
+
"version": 3
|
81 |
+
},
|
82 |
+
"file_extension": ".py",
|
83 |
+
"mimetype": "text/x-python",
|
84 |
+
"name": "python",
|
85 |
+
"nbconvert_exporter": "python",
|
86 |
+
"pygments_lexer": "ipython3",
|
87 |
+
"version": "3.10.8"
|
88 |
+
},
|
89 |
+
"vscode": {
|
90 |
+
"interpreter": {
|
91 |
+
"hash": "a938063cd11462c75ed0b512d93163eb8ad9c413327e29908f3f3089f7e731f2"
|
92 |
+
}
|
93 |
+
}
|
94 |
+
},
|
95 |
+
"nbformat": 4,
|
96 |
+
"nbformat_minor": 2
|
97 |
+
}
|