hotosm commited on
Commit
65adb1e
·
verified ·
1 Parent(s): 04876b2

feat : add norm_stats for the train split

Browse files
Files changed (2) hide show
  1. norm_stats.ipynb +965 -0
  2. norm_stats.json +22 -0
norm_stats.ipynb ADDED
@@ -0,0 +1,965 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ },
15
+ "widgets": {
16
+ "application/vnd.jupyter.widget-state+json": {
17
+ "786f8f2d2ae54f829af40c5a3dc33752": {
18
+ "model_module": "@jupyter-widgets/controls",
19
+ "model_name": "HBoxModel",
20
+ "model_module_version": "1.5.0",
21
+ "state": {
22
+ "_dom_classes": [],
23
+ "_model_module": "@jupyter-widgets/controls",
24
+ "_model_module_version": "1.5.0",
25
+ "_model_name": "HBoxModel",
26
+ "_view_count": null,
27
+ "_view_module": "@jupyter-widgets/controls",
28
+ "_view_module_version": "1.5.0",
29
+ "_view_name": "HBoxView",
30
+ "box_style": "",
31
+ "children": [
32
+ "IPY_MODEL_f0c5122294fd43d18c5c358cf42f3ce0",
33
+ "IPY_MODEL_0e317fc66c3d43db82023e8019ea030c",
34
+ "IPY_MODEL_1cef2e3e6b9746818307c991a01f8fca"
35
+ ],
36
+ "layout": "IPY_MODEL_cf8a8f0a61ea42998311ad2f63715111"
37
+ }
38
+ },
39
+ "f0c5122294fd43d18c5c358cf42f3ce0": {
40
+ "model_module": "@jupyter-widgets/controls",
41
+ "model_name": "HTMLModel",
42
+ "model_module_version": "1.5.0",
43
+ "state": {
44
+ "_dom_classes": [],
45
+ "_model_module": "@jupyter-widgets/controls",
46
+ "_model_module_version": "1.5.0",
47
+ "_model_name": "HTMLModel",
48
+ "_view_count": null,
49
+ "_view_module": "@jupyter-widgets/controls",
50
+ "_view_module_version": "1.5.0",
51
+ "_view_name": "HTMLView",
52
+ "description": "",
53
+ "description_tooltip": null,
54
+ "layout": "IPY_MODEL_b751f22abf8744a48b933d49cb34191f",
55
+ "placeholder": "​",
56
+ "style": "IPY_MODEL_abe0d63e23d04c31b258d662760c13e7",
57
+ "value": "Download complete: 100%"
58
+ }
59
+ },
60
+ "0e317fc66c3d43db82023e8019ea030c": {
61
+ "model_module": "@jupyter-widgets/controls",
62
+ "model_name": "FloatProgressModel",
63
+ "model_module_version": "1.5.0",
64
+ "state": {
65
+ "_dom_classes": [],
66
+ "_model_module": "@jupyter-widgets/controls",
67
+ "_model_module_version": "1.5.0",
68
+ "_model_name": "FloatProgressModel",
69
+ "_view_count": null,
70
+ "_view_module": "@jupyter-widgets/controls",
71
+ "_view_module_version": "1.5.0",
72
+ "_view_name": "ProgressView",
73
+ "bar_style": "success",
74
+ "description": "",
75
+ "description_tooltip": null,
76
+ "layout": "IPY_MODEL_10c83048ab324b26932d23db2c0810f6",
77
+ "max": 1,
78
+ "min": 0,
79
+ "orientation": "horizontal",
80
+ "style": "IPY_MODEL_0b4f4621b7254724809dad0c3c544985",
81
+ "value": 1
82
+ }
83
+ },
84
+ "1cef2e3e6b9746818307c991a01f8fca": {
85
+ "model_module": "@jupyter-widgets/controls",
86
+ "model_name": "HTMLModel",
87
+ "model_module_version": "1.5.0",
88
+ "state": {
89
+ "_dom_classes": [],
90
+ "_model_module": "@jupyter-widgets/controls",
91
+ "_model_module_version": "1.5.0",
92
+ "_model_name": "HTMLModel",
93
+ "_view_count": null,
94
+ "_view_module": "@jupyter-widgets/controls",
95
+ "_view_module_version": "1.5.0",
96
+ "_view_name": "HTMLView",
97
+ "description": "",
98
+ "description_tooltip": null,
99
+ "layout": "IPY_MODEL_3964ad6164774a44aead1a901a2ccbd0",
100
+ "placeholder": "​",
101
+ "style": "IPY_MODEL_323420ea0ea54b95b5807778d62d3b21",
102
+ "value": " 4.78G/4.78G [00:43<00:00, 178MB/s]"
103
+ }
104
+ },
105
+ "cf8a8f0a61ea42998311ad2f63715111": {
106
+ "model_module": "@jupyter-widgets/base",
107
+ "model_name": "LayoutModel",
108
+ "model_module_version": "1.2.0",
109
+ "state": {
110
+ "_model_module": "@jupyter-widgets/base",
111
+ "_model_module_version": "1.2.0",
112
+ "_model_name": "LayoutModel",
113
+ "_view_count": null,
114
+ "_view_module": "@jupyter-widgets/base",
115
+ "_view_module_version": "1.2.0",
116
+ "_view_name": "LayoutView",
117
+ "align_content": null,
118
+ "align_items": null,
119
+ "align_self": null,
120
+ "border": null,
121
+ "bottom": null,
122
+ "display": null,
123
+ "flex": null,
124
+ "flex_flow": null,
125
+ "grid_area": null,
126
+ "grid_auto_columns": null,
127
+ "grid_auto_flow": null,
128
+ "grid_auto_rows": null,
129
+ "grid_column": null,
130
+ "grid_gap": null,
131
+ "grid_row": null,
132
+ "grid_template_areas": null,
133
+ "grid_template_columns": null,
134
+ "grid_template_rows": null,
135
+ "height": null,
136
+ "justify_content": null,
137
+ "justify_items": null,
138
+ "left": null,
139
+ "margin": null,
140
+ "max_height": null,
141
+ "max_width": null,
142
+ "min_height": null,
143
+ "min_width": null,
144
+ "object_fit": null,
145
+ "object_position": null,
146
+ "order": null,
147
+ "overflow": null,
148
+ "overflow_x": null,
149
+ "overflow_y": null,
150
+ "padding": null,
151
+ "right": null,
152
+ "top": null,
153
+ "visibility": null,
154
+ "width": null
155
+ }
156
+ },
157
+ "b751f22abf8744a48b933d49cb34191f": {
158
+ "model_module": "@jupyter-widgets/base",
159
+ "model_name": "LayoutModel",
160
+ "model_module_version": "1.2.0",
161
+ "state": {
162
+ "_model_module": "@jupyter-widgets/base",
163
+ "_model_module_version": "1.2.0",
164
+ "_model_name": "LayoutModel",
165
+ "_view_count": null,
166
+ "_view_module": "@jupyter-widgets/base",
167
+ "_view_module_version": "1.2.0",
168
+ "_view_name": "LayoutView",
169
+ "align_content": null,
170
+ "align_items": null,
171
+ "align_self": null,
172
+ "border": null,
173
+ "bottom": null,
174
+ "display": null,
175
+ "flex": null,
176
+ "flex_flow": null,
177
+ "grid_area": null,
178
+ "grid_auto_columns": null,
179
+ "grid_auto_flow": null,
180
+ "grid_auto_rows": null,
181
+ "grid_column": null,
182
+ "grid_gap": null,
183
+ "grid_row": null,
184
+ "grid_template_areas": null,
185
+ "grid_template_columns": null,
186
+ "grid_template_rows": null,
187
+ "height": null,
188
+ "justify_content": null,
189
+ "justify_items": null,
190
+ "left": null,
191
+ "margin": null,
192
+ "max_height": null,
193
+ "max_width": null,
194
+ "min_height": null,
195
+ "min_width": null,
196
+ "object_fit": null,
197
+ "object_position": null,
198
+ "order": null,
199
+ "overflow": null,
200
+ "overflow_x": null,
201
+ "overflow_y": null,
202
+ "padding": null,
203
+ "right": null,
204
+ "top": null,
205
+ "visibility": null,
206
+ "width": null
207
+ }
208
+ },
209
+ "abe0d63e23d04c31b258d662760c13e7": {
210
+ "model_module": "@jupyter-widgets/controls",
211
+ "model_name": "DescriptionStyleModel",
212
+ "model_module_version": "1.5.0",
213
+ "state": {
214
+ "_model_module": "@jupyter-widgets/controls",
215
+ "_model_module_version": "1.5.0",
216
+ "_model_name": "DescriptionStyleModel",
217
+ "_view_count": null,
218
+ "_view_module": "@jupyter-widgets/base",
219
+ "_view_module_version": "1.2.0",
220
+ "_view_name": "StyleView",
221
+ "description_width": ""
222
+ }
223
+ },
224
+ "10c83048ab324b26932d23db2c0810f6": {
225
+ "model_module": "@jupyter-widgets/base",
226
+ "model_name": "LayoutModel",
227
+ "model_module_version": "1.2.0",
228
+ "state": {
229
+ "_model_module": "@jupyter-widgets/base",
230
+ "_model_module_version": "1.2.0",
231
+ "_model_name": "LayoutModel",
232
+ "_view_count": null,
233
+ "_view_module": "@jupyter-widgets/base",
234
+ "_view_module_version": "1.2.0",
235
+ "_view_name": "LayoutView",
236
+ "align_content": null,
237
+ "align_items": null,
238
+ "align_self": null,
239
+ "border": null,
240
+ "bottom": null,
241
+ "display": null,
242
+ "flex": null,
243
+ "flex_flow": null,
244
+ "grid_area": null,
245
+ "grid_auto_columns": null,
246
+ "grid_auto_flow": null,
247
+ "grid_auto_rows": null,
248
+ "grid_column": null,
249
+ "grid_gap": null,
250
+ "grid_row": null,
251
+ "grid_template_areas": null,
252
+ "grid_template_columns": null,
253
+ "grid_template_rows": null,
254
+ "height": null,
255
+ "justify_content": null,
256
+ "justify_items": null,
257
+ "left": null,
258
+ "margin": null,
259
+ "max_height": null,
260
+ "max_width": null,
261
+ "min_height": null,
262
+ "min_width": null,
263
+ "object_fit": null,
264
+ "object_position": null,
265
+ "order": null,
266
+ "overflow": null,
267
+ "overflow_x": null,
268
+ "overflow_y": null,
269
+ "padding": null,
270
+ "right": null,
271
+ "top": null,
272
+ "visibility": null,
273
+ "width": "20px"
274
+ }
275
+ },
276
+ "0b4f4621b7254724809dad0c3c544985": {
277
+ "model_module": "@jupyter-widgets/controls",
278
+ "model_name": "ProgressStyleModel",
279
+ "model_module_version": "1.5.0",
280
+ "state": {
281
+ "_model_module": "@jupyter-widgets/controls",
282
+ "_model_module_version": "1.5.0",
283
+ "_model_name": "ProgressStyleModel",
284
+ "_view_count": null,
285
+ "_view_module": "@jupyter-widgets/base",
286
+ "_view_module_version": "1.2.0",
287
+ "_view_name": "StyleView",
288
+ "bar_color": null,
289
+ "description_width": ""
290
+ }
291
+ },
292
+ "3964ad6164774a44aead1a901a2ccbd0": {
293
+ "model_module": "@jupyter-widgets/base",
294
+ "model_name": "LayoutModel",
295
+ "model_module_version": "1.2.0",
296
+ "state": {
297
+ "_model_module": "@jupyter-widgets/base",
298
+ "_model_module_version": "1.2.0",
299
+ "_model_name": "LayoutModel",
300
+ "_view_count": null,
301
+ "_view_module": "@jupyter-widgets/base",
302
+ "_view_module_version": "1.2.0",
303
+ "_view_name": "LayoutView",
304
+ "align_content": null,
305
+ "align_items": null,
306
+ "align_self": null,
307
+ "border": null,
308
+ "bottom": null,
309
+ "display": null,
310
+ "flex": null,
311
+ "flex_flow": null,
312
+ "grid_area": null,
313
+ "grid_auto_columns": null,
314
+ "grid_auto_flow": null,
315
+ "grid_auto_rows": null,
316
+ "grid_column": null,
317
+ "grid_gap": null,
318
+ "grid_row": null,
319
+ "grid_template_areas": null,
320
+ "grid_template_columns": null,
321
+ "grid_template_rows": null,
322
+ "height": null,
323
+ "justify_content": null,
324
+ "justify_items": null,
325
+ "left": null,
326
+ "margin": null,
327
+ "max_height": null,
328
+ "max_width": null,
329
+ "min_height": null,
330
+ "min_width": null,
331
+ "object_fit": null,
332
+ "object_position": null,
333
+ "order": null,
334
+ "overflow": null,
335
+ "overflow_x": null,
336
+ "overflow_y": null,
337
+ "padding": null,
338
+ "right": null,
339
+ "top": null,
340
+ "visibility": null,
341
+ "width": null
342
+ }
343
+ },
344
+ "323420ea0ea54b95b5807778d62d3b21": {
345
+ "model_module": "@jupyter-widgets/controls",
346
+ "model_name": "DescriptionStyleModel",
347
+ "model_module_version": "1.5.0",
348
+ "state": {
349
+ "_model_module": "@jupyter-widgets/controls",
350
+ "_model_module_version": "1.5.0",
351
+ "_model_name": "DescriptionStyleModel",
352
+ "_view_count": null,
353
+ "_view_module": "@jupyter-widgets/base",
354
+ "_view_module_version": "1.2.0",
355
+ "_view_name": "StyleView",
356
+ "description_width": ""
357
+ }
358
+ },
359
+ "0ad39833920d4de7b7aa51f6085a3dec": {
360
+ "model_module": "@jupyter-widgets/controls",
361
+ "model_name": "HBoxModel",
362
+ "model_module_version": "1.5.0",
363
+ "state": {
364
+ "_dom_classes": [],
365
+ "_model_module": "@jupyter-widgets/controls",
366
+ "_model_module_version": "1.5.0",
367
+ "_model_name": "HBoxModel",
368
+ "_view_count": null,
369
+ "_view_module": "@jupyter-widgets/controls",
370
+ "_view_module_version": "1.5.0",
371
+ "_view_name": "HBoxView",
372
+ "box_style": "",
373
+ "children": [
374
+ "IPY_MODEL_efed43fec5174d9f94cafa3a514ad782",
375
+ "IPY_MODEL_7bc6f531953e4019b9c4e3f58e65e375",
376
+ "IPY_MODEL_fb81c129a1a243dfbbed8ca97abf3d3a"
377
+ ],
378
+ "layout": "IPY_MODEL_701b32b7968f45a9be3ca916b46054e5"
379
+ }
380
+ },
381
+ "efed43fec5174d9f94cafa3a514ad782": {
382
+ "model_module": "@jupyter-widgets/controls",
383
+ "model_name": "HTMLModel",
384
+ "model_module_version": "1.5.0",
385
+ "state": {
386
+ "_dom_classes": [],
387
+ "_model_module": "@jupyter-widgets/controls",
388
+ "_model_module_version": "1.5.0",
389
+ "_model_name": "HTMLModel",
390
+ "_view_count": null,
391
+ "_view_module": "@jupyter-widgets/controls",
392
+ "_view_module_version": "1.5.0",
393
+ "_view_name": "HTMLView",
394
+ "description": "",
395
+ "description_tooltip": null,
396
+ "layout": "IPY_MODEL_80292e0ff56e411e9aa3264a21d5e268",
397
+ "placeholder": "​",
398
+ "style": "IPY_MODEL_3c1afc74ce2f4f04bc21205fdf3c35da",
399
+ "value": "Fetching 11 files: 100%"
400
+ }
401
+ },
402
+ "7bc6f531953e4019b9c4e3f58e65e375": {
403
+ "model_module": "@jupyter-widgets/controls",
404
+ "model_name": "FloatProgressModel",
405
+ "model_module_version": "1.5.0",
406
+ "state": {
407
+ "_dom_classes": [],
408
+ "_model_module": "@jupyter-widgets/controls",
409
+ "_model_module_version": "1.5.0",
410
+ "_model_name": "FloatProgressModel",
411
+ "_view_count": null,
412
+ "_view_module": "@jupyter-widgets/controls",
413
+ "_view_module_version": "1.5.0",
414
+ "_view_name": "ProgressView",
415
+ "bar_style": "success",
416
+ "description": "",
417
+ "description_tooltip": null,
418
+ "layout": "IPY_MODEL_5bc8b5bec88c40a4955a75e34461c427",
419
+ "max": 11,
420
+ "min": 0,
421
+ "orientation": "horizontal",
422
+ "style": "IPY_MODEL_6a5af22e0dd042689620c91ef0fca263",
423
+ "value": 11
424
+ }
425
+ },
426
+ "fb81c129a1a243dfbbed8ca97abf3d3a": {
427
+ "model_module": "@jupyter-widgets/controls",
428
+ "model_name": "HTMLModel",
429
+ "model_module_version": "1.5.0",
430
+ "state": {
431
+ "_dom_classes": [],
432
+ "_model_module": "@jupyter-widgets/controls",
433
+ "_model_module_version": "1.5.0",
434
+ "_model_name": "HTMLModel",
435
+ "_view_count": null,
436
+ "_view_module": "@jupyter-widgets/controls",
437
+ "_view_module_version": "1.5.0",
438
+ "_view_name": "HTMLView",
439
+ "description": "",
440
+ "description_tooltip": null,
441
+ "layout": "IPY_MODEL_70519aae570743138d8508975474863a",
442
+ "placeholder": "​",
443
+ "style": "IPY_MODEL_64baa0cc765e4288ac98e8153b46a600",
444
+ "value": " 11/11 [00:43<00:00,  3.08s/it]"
445
+ }
446
+ },
447
+ "701b32b7968f45a9be3ca916b46054e5": {
448
+ "model_module": "@jupyter-widgets/base",
449
+ "model_name": "LayoutModel",
450
+ "model_module_version": "1.2.0",
451
+ "state": {
452
+ "_model_module": "@jupyter-widgets/base",
453
+ "_model_module_version": "1.2.0",
454
+ "_model_name": "LayoutModel",
455
+ "_view_count": null,
456
+ "_view_module": "@jupyter-widgets/base",
457
+ "_view_module_version": "1.2.0",
458
+ "_view_name": "LayoutView",
459
+ "align_content": null,
460
+ "align_items": null,
461
+ "align_self": null,
462
+ "border": null,
463
+ "bottom": null,
464
+ "display": null,
465
+ "flex": null,
466
+ "flex_flow": null,
467
+ "grid_area": null,
468
+ "grid_auto_columns": null,
469
+ "grid_auto_flow": null,
470
+ "grid_auto_rows": null,
471
+ "grid_column": null,
472
+ "grid_gap": null,
473
+ "grid_row": null,
474
+ "grid_template_areas": null,
475
+ "grid_template_columns": null,
476
+ "grid_template_rows": null,
477
+ "height": null,
478
+ "justify_content": null,
479
+ "justify_items": null,
480
+ "left": null,
481
+ "margin": null,
482
+ "max_height": null,
483
+ "max_width": null,
484
+ "min_height": null,
485
+ "min_width": null,
486
+ "object_fit": null,
487
+ "object_position": null,
488
+ "order": null,
489
+ "overflow": null,
490
+ "overflow_x": null,
491
+ "overflow_y": null,
492
+ "padding": null,
493
+ "right": null,
494
+ "top": null,
495
+ "visibility": null,
496
+ "width": null
497
+ }
498
+ },
499
+ "80292e0ff56e411e9aa3264a21d5e268": {
500
+ "model_module": "@jupyter-widgets/base",
501
+ "model_name": "LayoutModel",
502
+ "model_module_version": "1.2.0",
503
+ "state": {
504
+ "_model_module": "@jupyter-widgets/base",
505
+ "_model_module_version": "1.2.0",
506
+ "_model_name": "LayoutModel",
507
+ "_view_count": null,
508
+ "_view_module": "@jupyter-widgets/base",
509
+ "_view_module_version": "1.2.0",
510
+ "_view_name": "LayoutView",
511
+ "align_content": null,
512
+ "align_items": null,
513
+ "align_self": null,
514
+ "border": null,
515
+ "bottom": null,
516
+ "display": null,
517
+ "flex": null,
518
+ "flex_flow": null,
519
+ "grid_area": null,
520
+ "grid_auto_columns": null,
521
+ "grid_auto_flow": null,
522
+ "grid_auto_rows": null,
523
+ "grid_column": null,
524
+ "grid_gap": null,
525
+ "grid_row": null,
526
+ "grid_template_areas": null,
527
+ "grid_template_columns": null,
528
+ "grid_template_rows": null,
529
+ "height": null,
530
+ "justify_content": null,
531
+ "justify_items": null,
532
+ "left": null,
533
+ "margin": null,
534
+ "max_height": null,
535
+ "max_width": null,
536
+ "min_height": null,
537
+ "min_width": null,
538
+ "object_fit": null,
539
+ "object_position": null,
540
+ "order": null,
541
+ "overflow": null,
542
+ "overflow_x": null,
543
+ "overflow_y": null,
544
+ "padding": null,
545
+ "right": null,
546
+ "top": null,
547
+ "visibility": null,
548
+ "width": null
549
+ }
550
+ },
551
+ "3c1afc74ce2f4f04bc21205fdf3c35da": {
552
+ "model_module": "@jupyter-widgets/controls",
553
+ "model_name": "DescriptionStyleModel",
554
+ "model_module_version": "1.5.0",
555
+ "state": {
556
+ "_model_module": "@jupyter-widgets/controls",
557
+ "_model_module_version": "1.5.0",
558
+ "_model_name": "DescriptionStyleModel",
559
+ "_view_count": null,
560
+ "_view_module": "@jupyter-widgets/base",
561
+ "_view_module_version": "1.2.0",
562
+ "_view_name": "StyleView",
563
+ "description_width": ""
564
+ }
565
+ },
566
+ "5bc8b5bec88c40a4955a75e34461c427": {
567
+ "model_module": "@jupyter-widgets/base",
568
+ "model_name": "LayoutModel",
569
+ "model_module_version": "1.2.0",
570
+ "state": {
571
+ "_model_module": "@jupyter-widgets/base",
572
+ "_model_module_version": "1.2.0",
573
+ "_model_name": "LayoutModel",
574
+ "_view_count": null,
575
+ "_view_module": "@jupyter-widgets/base",
576
+ "_view_module_version": "1.2.0",
577
+ "_view_name": "LayoutView",
578
+ "align_content": null,
579
+ "align_items": null,
580
+ "align_self": null,
581
+ "border": null,
582
+ "bottom": null,
583
+ "display": null,
584
+ "flex": null,
585
+ "flex_flow": null,
586
+ "grid_area": null,
587
+ "grid_auto_columns": null,
588
+ "grid_auto_flow": null,
589
+ "grid_auto_rows": null,
590
+ "grid_column": null,
591
+ "grid_gap": null,
592
+ "grid_row": null,
593
+ "grid_template_areas": null,
594
+ "grid_template_columns": null,
595
+ "grid_template_rows": null,
596
+ "height": null,
597
+ "justify_content": null,
598
+ "justify_items": null,
599
+ "left": null,
600
+ "margin": null,
601
+ "max_height": null,
602
+ "max_width": null,
603
+ "min_height": null,
604
+ "min_width": null,
605
+ "object_fit": null,
606
+ "object_position": null,
607
+ "order": null,
608
+ "overflow": null,
609
+ "overflow_x": null,
610
+ "overflow_y": null,
611
+ "padding": null,
612
+ "right": null,
613
+ "top": null,
614
+ "visibility": null,
615
+ "width": null
616
+ }
617
+ },
618
+ "6a5af22e0dd042689620c91ef0fca263": {
619
+ "model_module": "@jupyter-widgets/controls",
620
+ "model_name": "ProgressStyleModel",
621
+ "model_module_version": "1.5.0",
622
+ "state": {
623
+ "_model_module": "@jupyter-widgets/controls",
624
+ "_model_module_version": "1.5.0",
625
+ "_model_name": "ProgressStyleModel",
626
+ "_view_count": null,
627
+ "_view_module": "@jupyter-widgets/base",
628
+ "_view_module_version": "1.2.0",
629
+ "_view_name": "StyleView",
630
+ "bar_color": null,
631
+ "description_width": ""
632
+ }
633
+ },
634
+ "70519aae570743138d8508975474863a": {
635
+ "model_module": "@jupyter-widgets/base",
636
+ "model_name": "LayoutModel",
637
+ "model_module_version": "1.2.0",
638
+ "state": {
639
+ "_model_module": "@jupyter-widgets/base",
640
+ "_model_module_version": "1.2.0",
641
+ "_model_name": "LayoutModel",
642
+ "_view_count": null,
643
+ "_view_module": "@jupyter-widgets/base",
644
+ "_view_module_version": "1.2.0",
645
+ "_view_name": "LayoutView",
646
+ "align_content": null,
647
+ "align_items": null,
648
+ "align_self": null,
649
+ "border": null,
650
+ "bottom": null,
651
+ "display": null,
652
+ "flex": null,
653
+ "flex_flow": null,
654
+ "grid_area": null,
655
+ "grid_auto_columns": null,
656
+ "grid_auto_flow": null,
657
+ "grid_auto_rows": null,
658
+ "grid_column": null,
659
+ "grid_gap": null,
660
+ "grid_row": null,
661
+ "grid_template_areas": null,
662
+ "grid_template_columns": null,
663
+ "grid_template_rows": null,
664
+ "height": null,
665
+ "justify_content": null,
666
+ "justify_items": null,
667
+ "left": null,
668
+ "margin": null,
669
+ "max_height": null,
670
+ "max_width": null,
671
+ "min_height": null,
672
+ "min_width": null,
673
+ "object_fit": null,
674
+ "object_position": null,
675
+ "order": null,
676
+ "overflow": null,
677
+ "overflow_x": null,
678
+ "overflow_y": null,
679
+ "padding": null,
680
+ "right": null,
681
+ "top": null,
682
+ "visibility": null,
683
+ "width": null
684
+ }
685
+ },
686
+ "64baa0cc765e4288ac98e8153b46a600": {
687
+ "model_module": "@jupyter-widgets/controls",
688
+ "model_name": "DescriptionStyleModel",
689
+ "model_module_version": "1.5.0",
690
+ "state": {
691
+ "_model_module": "@jupyter-widgets/controls",
692
+ "_model_module_version": "1.5.0",
693
+ "_model_name": "DescriptionStyleModel",
694
+ "_view_count": null,
695
+ "_view_module": "@jupyter-widgets/base",
696
+ "_view_module_version": "1.2.0",
697
+ "_view_name": "StyleView",
698
+ "description_width": ""
699
+ }
700
+ }
701
+ }
702
+ }
703
+ },
704
+ "cells": [
705
+ {
706
+ "cell_type": "code",
707
+ "execution_count": 1,
708
+ "metadata": {
709
+ "id": "4W4f_7evsH2Q"
710
+ },
711
+ "outputs": [],
712
+ "source": [
713
+ "import io\n",
714
+ "import json\n",
715
+ "import tempfile\n",
716
+ "from pathlib import Path\n",
717
+ "\n",
718
+ "import numpy as np\n",
719
+ "import pyarrow.parquet as pq\n",
720
+ "from huggingface_hub import snapshot_download\n",
721
+ "from PIL import Image\n",
722
+ "from tqdm import tqdm\n",
723
+ "\n",
724
+ "REPO_ID = \"hotosm/vhr-building-segmentation\"\n",
725
+ "STATS_FILENAME = \"norm_stats.json\"\n",
726
+ "SPLIT_PREFIX = \"train\"\n",
727
+ "NUM_BANDS = 3\n",
728
+ "CHANNEL_NAMES = (\"R\", \"G\", \"B\")"
729
+ ]
730
+ },
731
+ {
732
+ "cell_type": "code",
733
+ "source": [
734
+ "def download_train_shards(target: Path) -> list[Path]:\n",
735
+ " snapshot_download(\n",
736
+ " repo_id=REPO_ID,\n",
737
+ " repo_type=\"dataset\",\n",
738
+ " local_dir=str(target),\n",
739
+ " allow_patterns=[f\"data/{SPLIT_PREFIX}-*.parquet\"],\n",
740
+ " )\n",
741
+ " data_dir = target / \"data\"\n",
742
+ " shards = sorted(data_dir.glob(f\"{SPLIT_PREFIX}-*.parquet\"))\n",
743
+ " if not shards:\n",
744
+ " raise FileNotFoundError(f\"No {SPLIT_PREFIX}-*.parquet shards downloaded to {data_dir}\")\n",
745
+ " return shards"
746
+ ],
747
+ "metadata": {
748
+ "id": "MGAkJoyHsMj7"
749
+ },
750
+ "execution_count": 2,
751
+ "outputs": []
752
+ },
753
+ {
754
+ "cell_type": "code",
755
+ "source": [
756
+ "def decode_rgb_array(cell: dict) -> np.ndarray:\n",
757
+ " img = Image.open(io.BytesIO(cell[\"bytes\"])).convert(\"RGB\")\n",
758
+ " return np.asarray(img, dtype=np.float32) / 255.0"
759
+ ],
760
+ "metadata": {
761
+ "id": "vC-5g3OxsSsO"
762
+ },
763
+ "execution_count": 3,
764
+ "outputs": []
765
+ },
766
+ {
767
+ "cell_type": "code",
768
+ "source": [
769
+ "def accumulate_stats(\n",
770
+ " shard_paths: list[Path],\n",
771
+ ") -> tuple[np.ndarray, np.ndarray, int, int]:\n",
772
+ " sum_px = np.zeros(NUM_BANDS, dtype=np.float64)\n",
773
+ " sum_sq = np.zeros(NUM_BANDS, dtype=np.float64)\n",
774
+ " n_pixels = 0\n",
775
+ " n_samples = 0\n",
776
+ " for shard in tqdm(shard_paths, desc=\"shards\", unit=\"shard\"):\n",
777
+ " table = pq.read_table(str(shard), columns=[\"image\"])\n",
778
+ " column = table[\"image\"]\n",
779
+ " for i in tqdm(range(len(column)), desc=shard.name, leave=False, unit=\"img\"):\n",
780
+ " arr = decode_rgb_array(column[i].as_py())\n",
781
+ " pixels = arr.reshape(-1, NUM_BANDS).astype(np.float64, copy=False)\n",
782
+ " sum_px += pixels.sum(axis=0)\n",
783
+ " sum_sq += np.square(pixels).sum(axis=0)\n",
784
+ " n_pixels += pixels.shape[0]\n",
785
+ " n_samples += 1\n",
786
+ " return sum_px, sum_sq, n_pixels, n_samples\n",
787
+ "\n",
788
+ "\n",
789
+ "def finalize_stats(\n",
790
+ " sum_px: np.ndarray, sum_sq: np.ndarray, n_pixels: int\n",
791
+ ") -> tuple[list[float], list[float]]:\n",
792
+ " mean = sum_px / n_pixels\n",
793
+ " variance = np.maximum(sum_sq / n_pixels - mean**2, 0.0)\n",
794
+ " std = np.sqrt(variance)\n",
795
+ " return mean.tolist(), std.tolist()\n",
796
+ "\n",
797
+ "\n",
798
+ "def write_stats_file(\n",
799
+ " path: Path,\n",
800
+ " mean: list[float],\n",
801
+ " std: list[float],\n",
802
+ " n_samples: int,\n",
803
+ " n_pixels: int,\n",
804
+ ") -> None:\n",
805
+ " payload = {\n",
806
+ " \"mean\": mean,\n",
807
+ " \"std\": std,\n",
808
+ " \"n_samples\": n_samples,\n",
809
+ " \"n_pixels\": n_pixels,\n",
810
+ " \"split\": SPLIT_PREFIX,\n",
811
+ " \"scale\": \"0-1\",\n",
812
+ " \"channels\": list(CHANNEL_NAMES),\n",
813
+ " \"source_repo\": REPO_ID,\n",
814
+ " }\n",
815
+ " path.write_text(json.dumps(payload, indent=2) + \"\\n\")\n"
816
+ ],
817
+ "metadata": {
818
+ "id": "HC_CORGksTdk"
819
+ },
820
+ "execution_count": 5,
821
+ "outputs": []
822
+ },
823
+ {
824
+ "cell_type": "code",
825
+ "source": [
826
+ "with tempfile.TemporaryDirectory(prefix=\"hotbuild_stats_\") as tmp:\n",
827
+ " shards = download_train_shards(Path(tmp))\n",
828
+ " total_rows = sum(pq.read_metadata(str(s)).num_rows for s in shards)\n",
829
+ " print(f\"Downloaded {len(shards)} shards, {total_rows:,} training samples\")\n",
830
+ "\n",
831
+ " sum_px, sum_sq, n_pixels, n_samples = accumulate_stats(shards)\n",
832
+ " mean, std = finalize_stats(sum_px, sum_sq, n_pixels)\n",
833
+ "\n",
834
+ "print(f\"n_samples = {n_samples:,}\")\n",
835
+ "print(f\"n_pixels = {n_pixels:,}\")\n",
836
+ "print(f\"mean = {mean}\")\n",
837
+ "print(f\"std = {std}\")\n",
838
+ "\n",
839
+ "out_path = Path.cwd() / STATS_FILENAME\n",
840
+ "write_stats_file(out_path, mean, std, n_samples, n_pixels)\n",
841
+ "print(f\"Wrote {out_path}\")"
842
+ ],
843
+ "metadata": {
844
+ "colab": {
845
+ "base_uri": "https://localhost:8080/",
846
+ "height": 597,
847
+ "referenced_widgets": [
848
+ "786f8f2d2ae54f829af40c5a3dc33752",
849
+ "f0c5122294fd43d18c5c358cf42f3ce0",
850
+ "0e317fc66c3d43db82023e8019ea030c",
851
+ "1cef2e3e6b9746818307c991a01f8fca",
852
+ "cf8a8f0a61ea42998311ad2f63715111",
853
+ "b751f22abf8744a48b933d49cb34191f",
854
+ "abe0d63e23d04c31b258d662760c13e7",
855
+ "10c83048ab324b26932d23db2c0810f6",
856
+ "0b4f4621b7254724809dad0c3c544985",
857
+ "3964ad6164774a44aead1a901a2ccbd0",
858
+ "323420ea0ea54b95b5807778d62d3b21",
859
+ "0ad39833920d4de7b7aa51f6085a3dec",
860
+ "efed43fec5174d9f94cafa3a514ad782",
861
+ "7bc6f531953e4019b9c4e3f58e65e375",
862
+ "fb81c129a1a243dfbbed8ca97abf3d3a",
863
+ "701b32b7968f45a9be3ca916b46054e5",
864
+ "80292e0ff56e411e9aa3264a21d5e268",
865
+ "3c1afc74ce2f4f04bc21205fdf3c35da",
866
+ "5bc8b5bec88c40a4955a75e34461c427",
867
+ "6a5af22e0dd042689620c91ef0fca263",
868
+ "70519aae570743138d8508975474863a",
869
+ "64baa0cc765e4288ac98e8153b46a600"
870
+ ]
871
+ },
872
+ "id": "4_i9Co3ysWSQ",
873
+ "outputId": "3092e2b4-562a-4899-ea01-c1ce2b22914c"
874
+ },
875
+ "execution_count": 6,
876
+ "outputs": [
877
+ {
878
+ "output_type": "stream",
879
+ "name": "stderr",
880
+ "text": [
881
+ "/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:93: UserWarning: \n",
882
+ "The secret `HF_TOKEN` does not exist in your Colab secrets.\n",
883
+ "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n",
884
+ "You will be able to reuse this secret in all of your notebooks.\n",
885
+ "Please note that authentication is recommended but still optional to access public models or datasets.\n",
886
+ " warnings.warn(\n"
887
+ ]
888
+ },
889
+ {
890
+ "output_type": "display_data",
891
+ "data": {
892
+ "text/plain": [
893
+ "Downloading (incomplete total...): 0.00B [00:00, ?B/s]"
894
+ ],
895
+ "application/vnd.jupyter.widget-view+json": {
896
+ "version_major": 2,
897
+ "version_minor": 0,
898
+ "model_id": "786f8f2d2ae54f829af40c5a3dc33752"
899
+ }
900
+ },
901
+ "metadata": {}
902
+ },
903
+ {
904
+ "output_type": "display_data",
905
+ "data": {
906
+ "text/plain": [
907
+ "Fetching 11 files: 0%| | 0/11 [00:00<?, ?it/s]"
908
+ ],
909
+ "application/vnd.jupyter.widget-view+json": {
910
+ "version_major": 2,
911
+ "version_minor": 0,
912
+ "model_id": "0ad39833920d4de7b7aa51f6085a3dec"
913
+ }
914
+ },
915
+ "metadata": {}
916
+ },
917
+ {
918
+ "output_type": "stream",
919
+ "name": "stderr",
920
+ "text": [
921
+ "Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n",
922
+ "WARNING:huggingface_hub.utils._http:Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n"
923
+ ]
924
+ },
925
+ {
926
+ "output_type": "stream",
927
+ "name": "stdout",
928
+ "text": [
929
+ "Downloaded 11 shards, 57,890 training samples\n"
930
+ ]
931
+ },
932
+ {
933
+ "output_type": "stream",
934
+ "name": "stderr",
935
+ "text": [
936
+ "\n",
937
+ " \n",
938
+ " \n",
939
+ " \n",
940
+ " \n",
941
+ " \n",
942
+ " \n",
943
+ " \n",
944
+ " \n",
945
+ " \n",
946
+ " \n",
947
+ " \n",
948
+ "shards: 100%|██████████| 11/11 [03:36<00:00, 19.69s/shard]\n"
949
+ ]
950
+ },
951
+ {
952
+ "output_type": "stream",
953
+ "name": "stdout",
954
+ "text": [
955
+ "n_samples = 57,890\n",
956
+ "n_pixels = 3,793,879,040\n",
957
+ "mean = [0.4296737853453577, 0.4001659668453235, 0.34333372802741474]\n",
958
+ "std = [0.2056069389373208, 0.16738555558380538, 0.1598986422586595]\n",
959
+ "Wrote /content/norm_stats.json\n"
960
+ ]
961
+ }
962
+ ]
963
+ }
964
+ ]
965
+ }
norm_stats.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "mean": [
3
+ 0.4296737853453577,
4
+ 0.4001659668453235,
5
+ 0.34333372802741474
6
+ ],
7
+ "std": [
8
+ 0.2056069389373208,
9
+ 0.16738555558380538,
10
+ 0.1598986422586595
11
+ ],
12
+ "n_samples": 57890,
13
+ "n_pixels": 3793879040,
14
+ "split": "train",
15
+ "scale": "0-1",
16
+ "channels": [
17
+ "R",
18
+ "G",
19
+ "B"
20
+ ],
21
+ "source_repo": "hotosm/vhr-building-segmentation"
22
+ }