jph00 commited on
Commit
f393bfb
1 Parent(s): 9b3c474
Files changed (2) hide show
  1. app.ipynb +6 -5
  2. train.ipynb +64 -21
app.ipynb CHANGED
@@ -70,9 +70,7 @@
70
  "cell_type": "code",
71
  "execution_count": 5,
72
  "id": "6e0bf9da",
73
- "metadata": {
74
- "scrolled": false
75
- },
76
  "outputs": [
77
  {
78
  "data": {
@@ -322,7 +320,10 @@
322
  "cell_type": "code",
323
  "execution_count": 16,
324
  "id": "82774c08",
325
- "metadata": {},
 
 
 
326
  "outputs": [
327
  {
328
  "data": {
@@ -791,7 +792,7 @@
791
  "name": "python",
792
  "nbconvert_exporter": "python",
793
  "pygments_lexer": "ipython3",
794
- "version": "3.9.5"
795
  },
796
  "toc": {
797
  "base_numbering": 1,
 
70
  "cell_type": "code",
71
  "execution_count": 5,
72
  "id": "6e0bf9da",
73
+ "metadata": {},
 
 
74
  "outputs": [
75
  {
76
  "data": {
 
320
  "cell_type": "code",
321
  "execution_count": 16,
322
  "id": "82774c08",
323
+ "metadata": {
324
+ "scrolled": true,
325
+ "tags": []
326
+ },
327
  "outputs": [
328
  {
329
  "data": {
 
792
  "name": "python",
793
  "nbconvert_exporter": "python",
794
  "pygments_lexer": "ipython3",
795
+ "version": "3.7.11"
796
  },
797
  "toc": {
798
  "base_numbering": 1,
train.ipynb CHANGED
@@ -10,7 +10,7 @@
10
  },
11
  {
12
  "cell_type": "code",
13
- "execution_count": 2,
14
  "id": "44eb0ad3",
15
  "metadata": {},
16
  "outputs": [],
@@ -21,7 +21,7 @@
21
  },
22
  {
23
  "cell_type": "code",
24
- "execution_count": 3,
25
  "id": "d838c0b3",
26
  "metadata": {},
27
  "outputs": [],
@@ -145,19 +145,62 @@
145
  "learn.fine_tune(3)"
146
  ]
147
  },
 
 
 
 
 
 
 
 
148
  {
149
  "cell_type": "code",
150
  "execution_count": 6,
151
- "id": "931ab602",
152
  "metadata": {},
153
  "outputs": [
154
  {
155
- "name": "stderr",
156
- "output_type": "stream",
157
- "text": [
158
- "Downloading: \"https://dl.fbaipublicfiles.com/convnext/convnext_tiny_22k_224.pth\" to /root/.cache/torch/hub/checkpoints/convnext_tiny_22k_224.pth\n"
159
- ]
160
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  {
162
  "data": {
163
  "text/html": [
@@ -174,9 +217,9 @@
174
  " <tbody>\n",
175
  " <tr>\n",
176
  " <td>0</td>\n",
177
- " <td>1.121368</td>\n",
178
- " <td>0.267543</td>\n",
179
- " <td>0.080514</td>\n",
180
  " <td>00:24</td>\n",
181
  " </tr>\n",
182
  " </tbody>\n",
@@ -205,23 +248,23 @@
205
  " <tbody>\n",
206
  " <tr>\n",
207
  " <td>0</td>\n",
208
- " <td>0.288129</td>\n",
209
- " <td>0.223384</td>\n",
210
- " <td>0.069689</td>\n",
211
  " <td>00:27</td>\n",
212
  " </tr>\n",
213
  " <tr>\n",
214
  " <td>1</td>\n",
215
- " <td>0.204079</td>\n",
216
- " <td>0.197346</td>\n",
217
- " <td>0.067659</td>\n",
218
  " <td>00:27</td>\n",
219
  " </tr>\n",
220
  " <tr>\n",
221
  " <td>2</td>\n",
222
- " <td>0.131804</td>\n",
223
- " <td>0.183479</td>\n",
224
- " <td>0.058863</td>\n",
225
  " <td>00:27</td>\n",
226
  " </tr>\n",
227
  " </tbody>\n",
 
10
  },
11
  {
12
  "cell_type": "code",
13
+ "execution_count": 1,
14
  "id": "44eb0ad3",
15
  "metadata": {},
16
  "outputs": [],
 
21
  },
22
  {
23
  "cell_type": "code",
24
+ "execution_count": 7,
25
  "id": "d838c0b3",
26
  "metadata": {},
27
  "outputs": [],
 
145
  "learn.fine_tune(3)"
146
  ]
147
  },
148
+ {
149
+ "cell_type": "markdown",
150
+ "id": "477ef53a-4b5c-4a07-81c2-95b8e7397cac",
151
+ "metadata": {},
152
+ "source": [
153
+ "We could try a better model, based on [this analysis](https://www.kaggle.com/code/jhoward/which-image-models-are-best/). The convnext models work great!"
154
+ ]
155
+ },
156
  {
157
  "cell_type": "code",
158
  "execution_count": 6,
159
+ "id": "6ee4197a-25be-48ac-a167-903bec5186b1",
160
  "metadata": {},
161
  "outputs": [
162
  {
163
+ "data": {
164
+ "text/plain": [
165
+ "['convnext_base',\n",
166
+ " 'convnext_base_384_in22ft1k',\n",
167
+ " 'convnext_base_in22ft1k',\n",
168
+ " 'convnext_base_in22k',\n",
169
+ " 'convnext_large',\n",
170
+ " 'convnext_large_384_in22ft1k',\n",
171
+ " 'convnext_large_in22ft1k',\n",
172
+ " 'convnext_large_in22k',\n",
173
+ " 'convnext_nano_hnf',\n",
174
+ " 'convnext_small',\n",
175
+ " 'convnext_small_384_in22ft1k',\n",
176
+ " 'convnext_small_in22ft1k',\n",
177
+ " 'convnext_small_in22k',\n",
178
+ " 'convnext_tiny',\n",
179
+ " 'convnext_tiny_384_in22ft1k',\n",
180
+ " 'convnext_tiny_hnf',\n",
181
+ " 'convnext_tiny_hnfd',\n",
182
+ " 'convnext_tiny_in22ft1k',\n",
183
+ " 'convnext_tiny_in22k',\n",
184
+ " 'convnext_xlarge_384_in22ft1k',\n",
185
+ " 'convnext_xlarge_in22ft1k',\n",
186
+ " 'convnext_xlarge_in22k']"
187
+ ]
188
+ },
189
+ "execution_count": 6,
190
+ "metadata": {},
191
+ "output_type": "execute_result"
192
+ }
193
+ ],
194
+ "source": [
195
+ "timm.list_models('convnext*')"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type": "code",
200
+ "execution_count": 9,
201
+ "id": "67d34f88-a580-48b9-9b42-e9d0c7e3e870",
202
+ "metadata": {},
203
+ "outputs": [
204
  {
205
  "data": {
206
  "text/html": [
 
217
  " <tbody>\n",
218
  " <tr>\n",
219
  " <td>0</td>\n",
220
+ " <td>1.113290</td>\n",
221
+ " <td>0.253742</td>\n",
222
+ " <td>0.087957</td>\n",
223
  " <td>00:24</td>\n",
224
  " </tr>\n",
225
  " </tbody>\n",
 
248
  " <tbody>\n",
249
  " <tr>\n",
250
  " <td>0</td>\n",
251
+ " <td>0.293625</td>\n",
252
+ " <td>0.205537</td>\n",
253
+ " <td>0.067659</td>\n",
254
  " <td>00:27</td>\n",
255
  " </tr>\n",
256
  " <tr>\n",
257
  " <td>1</td>\n",
258
+ " <td>0.195267</td>\n",
259
+ " <td>0.185939</td>\n",
260
+ " <td>0.055480</td>\n",
261
  " <td>00:27</td>\n",
262
  " </tr>\n",
263
  " <tr>\n",
264
  " <td>2</td>\n",
265
+ " <td>0.123829</td>\n",
266
+ " <td>0.172681</td>\n",
267
+ " <td>0.055480</td>\n",
268
  " <td>00:27</td>\n",
269
  " </tr>\n",
270
  " </tbody>\n",