forked from fastai/fastai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vision.data.html
2176 lines (1570 loc) · 280 KB
/
vision.data.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: vision.data
keywords: fastai
sidebar: home_sidebar
summary: "Basic dataset for computer vision and helper function to get a DataBunch"
---
<!--
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: docs_src/vision.data.ipynb
# instructions: https://docs.fast.ai/gen_doc_main.html
-->
<div class="container" id="notebook-container">
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Computer-vision-data">Computer vision data<a class="anchor-link" href="#Computer-vision-data">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This module contains the classes that define datasets handling <a href="/vision.image.html#Image"><code>Image</code></a> objects and their transformations. As usual, we'll start with a quick overview, before we get in to the detailed API docs.</p>
<p>Before any work can be done a dataset needs to be converted into a <a href="/basic_data.html#DataBunch"><code>DataBunch</code></a> object, and in the case of the computer vision data - specifically into an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> subclass.</p>
<p>This is done with the help of <a href="/data_block.html">data block API</a> and the <a href="/vision.data.html#ImageList"><code>ImageList</code></a> class and its subclasses.</p>
<p>However, there is also a group of shortcut methods provided by <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> which reduce the multiple stages of the data block API, into a single wrapper method. These shortcuts methods work really well for:</p>
<ul>
<li>Imagenet-style of datasets (<a href="/vision.data.html#ImageDataBunch.from_folder"><code>ImageDataBunch.from_folder</code></a>)</li>
<li>A pandas <code>DataFrame</code> with a column of filenames and a column of labels which can be strings for classification, strings separated by a <code>label_delim</code> for multi-classification or floats for a regression problem (<a href="/vision.data.html#ImageDataBunch.from_df"><code>ImageDataBunch.from_df</code></a>)</li>
<li>A csv file with the same format as above (<a href="/vision.data.html#ImageDataBunch.from_csv"><code>ImageDataBunch.from_csv</code></a>)</li>
<li>A list of filenames and a list of targets (<a href="/vision.data.html#ImageDataBunch.from_lists"><code>ImageDataBunch.from_lists</code></a>)</li>
<li>A list of filenames and a function to get the target from the filename (<a href="/vision.data.html#ImageDataBunch.from_name_func"><code>ImageDataBunch.from_name_func</code></a>)</li>
<li>A list of filenames and a regex pattern to get the target from the filename (<a href="/vision.data.html#ImageDataBunch.from_name_re"><code>ImageDataBunch.from_name_re</code></a>)</li>
</ul>
<p>In the last five factory methods, a random split is performed between train and validation, in the first one it can be a random split or a separation from a training and a validation folder.</p>
<p>If you're just starting out you may choose to experiment with these shortcut methods, as they are also used in the first lessons of the fastai deep learning course. However, you can completely skip them and start building your code using the data block API from the very beginning. Internally, these shortcuts use this API anyway.</p>
<p>The first part of this document is dedicated to the shortcut <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> factory methods. Then all the other computer vision data-specific methods that are used with the data block API are presented.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Quickly-get-your-data-ready-for-training">Quickly get your data ready for training<a class="anchor-link" href="#Quickly-get-your-data-ready-for-training">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>To get you started as easily as possible, the fastai provides two helper functions to create a <a href="/basic_data.html#DataBunch"><code>DataBunch</code></a> object that you can directly use for training a classifier. To demonstrate them you'll first need to download and untar the file by executing the following cell. This will create a data folder containing an MNIST subset in <code>data/mnist_sample</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">path</span> <span class="o">=</span> <span class="n">untar_data</span><span class="p">(</span><span class="n">URLs</span><span class="o">.</span><span class="n">MNIST_SAMPLE</span><span class="p">);</span> <span class="n">path</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>PosixPath('/home/ubuntu/.fastai/data/mnist_sample')</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>There are a number of ways to create an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a>. One common approach is to use <em>Imagenet-style folders</em> (see a ways down the page below for details) with <a href="/vision.data.html#ImageDataBunch.from_folder"><code>ImageDataBunch.from_folder</code></a>:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">tfms</span> <span class="o">=</span> <span class="n">get_transforms</span><span class="p">(</span><span class="n">do_flip</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_folder</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Here the datasets will be automatically created in the structure of <em>Imagenet-style folders</em>. The parameters specified:</p>
<ul>
<li>the transforms to apply to the images in <code>ds_tfms</code> (here with <code>do_flip</code>=False because we don't want to flip numbers),</li>
<li>the target <code>size</code> of our pictures (here 24).</li>
</ul>
<p>As with all <a href="/basic_data.html#DataBunch"><code>DataBunch</code></a> usage, a <code>train_dl</code> and a <code>valid_dl</code> are created that are of the type PyTorch <a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>.</p>
<p>If you want to have a look at a few images inside a batch, you can use <a href="/basic_data.html#DataBunch.show_batch"><code>DataBunch.show_batch</code></a>. The <code>rows</code> argument is the number of rows and columns to display.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span><span class="o">.</span><span class="n">show_batch</span><span class="p">(</span><span class="n">rows</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">))</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_png output_subarea ">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAAFgCAYAAADpZ/FJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3WmQVOXZxvH7ALKDsgqI7PuqIEZQBAVFIaISUSER45JK3jKaVL6kUiZVpqKWWYyKKSmXpCKKGsUVIyoiRhYBFwRl33dkUTYRFDzvh7zeXN1v9zAzTy/T3f9flVUXw8z0Caf7ybmfNYrj2AAAlVct3xcAAIWOhhQAAtGQAkAgGlIACERDCgCBaEgBIBANKQAEKrmGNIqig0n/HYui6MF8XxcqL4qiJ6Mo2h5F0f4oilZFUXRzvq8JlVeI9zMq5Qn5URTVM7PPzGxkHMfv5vt6UDlRFPU0szVxHB+Joqibmb1jZqPiOP4wv1eGyijE+1lyT6RJrjKznWY2O98XgsqL43hpHMdHvvvj//3XMY+XhACFeD9LvSG93swmx6X8WF4koih6KIqiQ2a2wsy2m9lreb4kBCi0+1mypX0URW3MbL2ZdYrjeH2+rwfhoiiqbmYDzWyomf0xjuNv8ntFCFFI97OUn0gnmNkcGtHiEcfxsTiO55hZazP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UAILRkAJAoJyW9p07d/Y8ePBgz0OGDPGs5ZxOon3jjTc8a0kdMsld1+uaJU681wnguvP+xx9/7Fkn+uuIdKn461//6vmFF17wXOEzwWXUVe//uHHjPF911VWedR8Enc2hB6eZmb366quei22fg0KR7iSEXr16eR49erRnLe21+88sfTmvi2xeeuklz9old91113nW2Rx6iJ6+b3XbTl2bnw5PpAAQiIYUAALltLTXXeR1BE7XZutE7blz53rWkfqKTrxPJ7m012vSEX0dbdZRQS3nc72lWFUwadKklF/XyfO6f4FuQaijoqeffrrnjh07ek43Uq+LObSc17LOLPEQQkr73NFyXrtq9DDLiy++2HP//v0964i6/p6y6HvpzjvvrNjFpqHvF+3mS4cnUgAIREMKAIHydvidjpDrWus333zTs05y37hxY0auQUcC9ZA2s8RD63TNrh5ap6P2mbqmYqAjqkOHDvWsa6d19oOWS2effbZnPbxMS7avvvrKs96Pp59+2rPudo6qQSe868GWWtqnG40vL+0C0L0t9AQM7XrThT66zaN2K+j3fPrpp561G1LxRAoAgWhIASAQDSkABMppH6lObdEjIrQPYsqUKZ515VCmphdpv+iAAQMS/k77bXUDg/fee8/zsmXLPOs0nFKkq0V0FZL2NesmNDr9SftLNevmImrr1q2etZ9a3zvJm9BovypyRz87uvJQNw7RsQptC8raK1b/7tlnn/Ws09x0UyHt59QxD33tK664wnPz5s096/vtscce86wbLCmeSAEgEA0pAATKaWmvpz/q6iSdwqJ7/2VjtZBOu9FTCc0SS0PdU1S7GCq6IUcxu/nmmz1rOa8rm8qzOkWnv+lKGC35dfXT+PHjPbdu3dqzbpxixnSoqmD//v2etRzXMl/fL1qaa07+s25Wk64LR7uS9HOv71XNOl1KT5195513Uv5+xRMpAASiIQWAQDkt7Z944gnPWnbpY75uEJINZW1eoasitm/f7lnLfI6pOK5Ro0aedYWIlvM6oqqnruqxIHrP0600OeOMMzzr5jfDhw/3nLwJjXbd/OMf/0j5esgu/UytXbs2Zc4W3bdWZ5VcdtllnnVWwWuvveZZTyfWrqd0eCIFgEA0p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rW017JSX0+7ErRE3Lhxo+eFCxcayvb+++97fuONNzzr/dR7Y5Y4A+Kaa67xrJPndRRe98vQ37t69WrPEydO9Lxr1y7PHH4HADlGQwoAgSjthZZtugZXS7jK7LyP8tPSTP/dtXtFt6+rV6+e52HDhiX8Lt0WUQ9D1FJdy78aNY5/HHRBhr4vtOTTA9KmTJniee7cuYay6cwGPU9eR8uvvvrqhJ8577zzPGv3jM7uUDoDRH+vdsPo6H9Itx1PpAAQiIYUAAJR2ot0pb3u2h2yHhcnpmX74sWLPd9xxx2ehw4d6llHdrt165bwu7SE17JND0zUQ86020ZH+XXStp7I8M4773hesGCBZx39RWr6OdJ/0+eff95z8mkUun3mwIEDPWuZr3th6O9dtmyZ55kzZ6b8/hA8kQJAIBpSAAgUZWPXaQAoJTyRAkAgGlIACERDCgCBaEgBIBANKQAEoiEFgEA0pAAQiIYUAALRkAJAIBpSAAhEQwoAgWhIASAQDSkABKIhBYBANKQAEIiGFAAC0ZACQCAaUgAIREMKAIFoSAEgEA0pAASiIQWAQDSkABDofwHIWK/BesWovwAAAABJRU5ErkJggg==
"
>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>The second way to define the data for a classifier requires a structure like this:</p>
<pre><code>path\
train\
test\
labels.csv</code></pre>
<p>where the labels.csv file defines the label(s) of each image in the training set. This is the format you will need to use when each image can have multiple labels. It also works with single labels:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">path</span><span class="o">/</span><span class="s1">'labels.csv'</span><span class="p">)</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_html rendered_html output_subarea output_execute_result">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>name</th>
<th>label</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>train/3/7463.png</td>
<td>0</td>
</tr>
<tr>
<th>1</th>
<td>train/3/21102.png</td>
<td>0</td>
</tr>
<tr>
<th>2</th>
<td>train/3/31559.png</td>
<td>0</td>
</tr>
<tr>
<th>3</th>
<td>train/3/46882.png</td>
<td>0</td>
</tr>
<tr>
<th>4</th>
<td>train/3/26209.png</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>You can then use <a href="/vision.data.html#ImageDataBunch.from_csv"><code>ImageDataBunch.from_csv</code></a>:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_csv</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">28</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span><span class="o">.</span><span class="n">show_batch</span><span class="p">(</span><span class="n">rows</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">))</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_png output_subarea ">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAAFgCAYAAADpZ/FJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3VmQVdX1x/HvEVSQQcURBxAEHEBAnEElDohTnNAkGpOYBJPKHCtDJRWTh39MpVJJTCrDQypxJHFIHAiC8wgqgmhERBFQxAEFBxwAFdD7f8C1zjr0pbvpfbtv33t/nxd2rW66T/e5d/feZ+29dlYqlRARkbbbotoXICJS69SRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpKoITvSLMv6ZFl2c5Zlq7MsW5pl2XnVviZpO93P+pJl2bezLJuTZdmHWZZdWe3raY2u1b6AKvkrsBbYBRgJTMuybG6pVJpf3cuSNtL9rC/LgEuA8UD3Kl9Lq2SNtrMpy7IewEpgWKlUWvhJbBLwSqlU+klVL042m+5n/cqy7BJgj1KpdEG1r6UljTi1HwJ8ZG+6T8wFhlbpeiSN7qdUXSN2pD2BdzaKvQP0qsK1SDrdT6m6RuxIVwG9N4r1Bt6rwrVIOt1PqbpG7EgXAl2zLBscYiMAJSZqk+6nVF3DdaSlUmk1cBPwf1mW9ciybAxwOjCpulcmbaH7WX+yLOuaZVk3oAvQJcuyblmWdeoVRg3XkX7im2xYVrECuBb4hpbK1DTdz/pyMfA+8BPg/E/aF1f1ilrQcMufREQqrVFHpCIiFaOOVEQkkTpSEZFE6khFRBJ16JKCLMuU2WpBqVTKqn0NraX72TLdz/qyqfupEamISCJ1pCIiidSRiogkUkcqIpKoU+9fFQHo0qWLt7feemsAunfPC6dbe926dR5bsWKFt7V7r2NtsUU+PrN79/HHH3ss3g/73K5d867I7uNHH33UrtdZSRqRiogkUkcqIpKo7qf23bp1A4pTwd69N9QB3mGHHTzWq1deUH3PPfcEoE+fPh576aWXvP3BBx8A8PLLL3vsueeeA+D999/3mKaUlbHtttt6e6eddgKK92v48OEADBo0yGNr16719vTp0wF48803Pfbiiy96+513NhTYj9PPRrfNNtsA+e8bYOeddwaKr3F7fwG8/fbbQP74BWD33XcHYOXKlR5777285rZ9rn1tgP79+wNw9913e8zuEcCOO+7YJDZgwIAmnxuvfc6cOU2uvZI0IhURSdTpR6TxwfWWW24JFP8K2l/Ovfbay2MjR470ds+ePQv/Auyyyy4A7Lvvvh6LCY2+ffsCxZHQs88+620b7cS/rEuXLgXgsssu89jChfl5bO31l7ARDB6cF78/5ZRTANh///091qNHDyAfyUDxftr9jqOiadOmeXvBggVAcYSzfv36ilx7rRo1ahQAEyZM8JjN4N59912PxSTRq6++CuTvSYBjjjkGgLfeestjH374obfHjRvX5Hvb++rrX/+6x5YvX+5tmxHG2Pbbb+9tu8/xNfL73/8egBkzZngs3u9UGpGKiCRSRyoikqhTTe3twfN2223nMZuWQf7gep999vHYHnvsAcDAgQM9NmTIEG/btC9O7S1REaclLTn88MObxOK6xVWrVgH5tANgypQp3n7wwQdb/b2kaNddd/W23dsDDzzQY3ZvY3IwTh+PP/54oDiVi4+H7N5YQgLy5GKjJgzt93zuued6LE6fWyvLNtT42Jzfo32f2A+09vts6nvZ47qf/vSnHrv55ptb/fVbohGpiEgidaQiIomqNrW3dZ1xOmaZ95NPPtljlj0E2G233QDYe++9PRanaK3V0nTD1hvGbYZxzamtebNVBJBPRw444ACPPfnkk97W1L7t4j22e3PllVd6zKbhw4YN85itNYT88VDM/n/rW9/y9lFHHQXA5Zdf7rFbbrkFKK4VbiT2+4vvz1p+zGHrTK0PqTSNSEVEEnXoiDSOLA455BAAPve5z3ns0EMPBYprQm0XUhSTBjZiiLG4vvOZZ54BYP78/JhzW+/2xhtveCyuc7MdGrFoQnxI/Z3vfKfJNdlf6/hX2xJQkK+tW7NmTZP/K82bOXOmt21HUkwm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Hbdgx23Qa9euBVo+EDA+lrHHLfF90xK7n/F7x2m+rYyJK3Xam0akIiKJOuWINI704lpMK41miQDI1/PZQ2uAPffc09uWbIrJIhuxxjVy5YqaRHFUY9d37LHHeuykk04C8t1XAI8++qi3bQ3i448/7rFKjZbrXby3dtDd8ccf7zErUNLSqCbe71j0xO7J5MmTPWYj0jgTqXdxh52NzuPvtG/fvgDstttuHosFhJobibZ08GBbxATUYYcd5m0rXqMRqYhIDVFHKiKSqFNN7W3NWqxmf9xxx3n7Rz/6EQDXX3+9x2wKEguM7L777t62qVmsJfniiy8C8PTTT3ssbhG1aX6c1sR6paNHjwbgoosu8pg9Lrjqqqs89uCDD3r7mWeeATSdb624HveYY47xtiWW7OQDyNfzxuReXCts9zMWqbEapgB33303APfcc4/H7DXSSOI26/POOw8oPmb70pe+BMD3v/99j8XtmDbVjrV7bfvupg4jbCkx1Vpxu3e5+rLtTSNSEZFEnWpEan9J4o6EWIzAypidffbZHrPdQXHEGUe0ZuLEid620eftt9/uMVueBPloJC6viMVITj311ML1AnznO98BikVJYmGLcsUdpCkraGGjfoDzzz/f24cccghQHH3a7zYmDOOI0pblzJ4922NXX321t+fPnw/o3K1y4gzqiiuuAIq7veKI0hI+do8gnx3G3225pYQtxeJuqSuvvBIozlrKFTXpSBqRiogkUkcqIpKoU03tbRoRpxOxVqdN+7773e96zHZZxGldTDTYMD8+7LY6h7HqfdwpY7sk4nQkJptsWvnf//7XY7a2VcfzprHHNrEASZwq2r2LxTSsWEasQ/urX/3K2zZFjOskY7ENVbtvHXvdx8dtkT1O+c9//tOu12GPzOLUPu5sjO2OohGpiEgidaQiIok61dS+nFgj0uoM2rZPyNcYxkIIsU7o0KFDgeLxBrb2LT4OiFn5cuL0z7KGMesfM/zSOvbYpV+/fh6zdcOxMIatRYR8DWJ8VGOPU+KW3IceesjblvGt1JpFqS7rE+L9jCtoytWabW8akYqIJOr0I9I4arSH3PFhtu0eip8XR49W0CIWMrERayx0EHdQWbIrjnpisRGrl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HXNx0ipxbZ8dWheLzJx77rlAfggelE8sxbWhth44nmt/zTXXeHvBggWply1VFtd8l3s0F9cVW7LpN7/5jcdsO3h71RjWiFREJFGnH5HGpIItibEEEsAdd9wB5EfugkahnVk8k2ns2LEATJw40WN2j2PBiciWubz66qsesxKINhIBWLx4sbfXrFmTetlSZXGWaUsav/Wtb5X93OHDhwPFpJOKloiIdHLqSEVEEmU6WlhEJI1GpCIiidSRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpJIHamISCJ1pCIiidSRiogkUkcqIpLo/wFBVhwORz8H+AAAAABJRU5ErkJggg==
"
>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>An example of multiclassification can be downloaded with the following cell. It's a sample of the <a href="https://www.google.com/search?q=kaggle+planet&rlz=1C1CHBF_enFR786FR786&oq=kaggle+planet&aqs=chrome..69i57j0.1563j0j7&sourceid=chrome&ie=UTF-8">planet dataset</a>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">planet</span> <span class="o">=</span> <span class="n">untar_data</span><span class="p">(</span><span class="n">URLs</span><span class="o">.</span><span class="n">PLANET_SAMPLE</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>If we open the labels files, we seach that each image has one or more tags, separated by a space.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">planet</span><span class="o">/</span><span class="s1">'labels.csv'</span><span class="p">)</span>
<span class="n">df</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_html rendered_html output_subarea output_execute_result">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>image_name</th>
<th>tags</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>train_21983</td>
<td>partly_cloudy primary</td>
</tr>
<tr>
<th>1</th>
<td>train_9516</td>
<td>clear cultivation primary water</td>
</tr>
<tr>
<th>2</th>
<td>train_12664</td>
<td>haze primary</td>
</tr>
<tr>
<th>3</th>
<td>train_36960</td>
<td>clear primary</td>
</tr>
<tr>
<th>4</th>
<td>train_5302</td>
<td>haze primary road</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_csv</span><span class="p">(</span><span class="n">planet</span><span class="p">,</span> <span class="n">folder</span><span class="o">=</span><span class="s1">'train'</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">128</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s1">'.jpg'</span><span class="p">,</span> <span class="n">label_delim</span><span class="o">=</span><span class="s1">' '</span><span class="p">,</span>
<span class="n">ds_tfms</span><span class="o">=</span><span class="n">get_transforms</span><span class="p">(</span><span class="n">flip_vert</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">max_lighting</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">max_zoom</span><span class="o">=</span><span class="mf">1.05</span><span class="p">,</span> <span class="n">max_warp</span><span class="o">=</span><span class="mf">0.</span><span class="p">))</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>The <code>show_batch</code>method will then print all the labels that correspond to each image.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span><span class="o">.</span><span class="n">show_batch</span><span class="p">(</span><span class="n">rows</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">8</span><span class="p">),</span> <span class="n">ds_type</span><span class="o">=</span><span class="n">DatasetType</span><span class="o">.</span><span class="n">Valid</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>You can find more ways to build an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> without the factory methods in <a href="/data_block.html#data_block"><code>data_block</code></a>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="ImageDataBunch" class="doc_header"><code>class</code> <code>ImageDataBunch</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L85" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>ImageDataBunch</code>(<strong><code>train_dl</code></strong>:<a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>, <strong><code>valid_dl</code></strong>:<a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>, <strong><code>fix_dl</code></strong>:<a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>=<strong><em><code>None</code></em></strong>, <strong><code>test_dl</code></strong>:<code>Optional</code>[<a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>]=<strong><em><code>None</code></em></strong>, <strong><code>device</code></strong>:<a href="https://pytorch.org/docs/stable/tensor_attributes.html#torch-device"><code>device</code></a>=<strong><em><code>None</code></em></strong>, <strong><code>dl_tfms</code></strong>:<code>Optional</code>[<code>Collection</code>[<code>Callable</code>]]=<strong><em><code>None</code></em></strong>, <strong><code>path</code></strong>:<code>PathOrStr</code>=<strong><em><code>'.'</code></em></strong>, <strong><code>collate_fn</code></strong>:<code>Callable</code>=<strong><em><code>'data_collate'</code></em></strong>, <strong><code>no_check</code></strong>:<code>bool</code>=<strong><em><code>False</code></em></strong>) :: <a href="/basic_data.html#DataBunch"><code>DataBunch</code></a></p>
</blockquote>
<div class="collapse" id="ImageDataBunch-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>ImageDataBunch</code>:</p><p>Some other tests where <code>ImageDataBunch</code> is used:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_clean_tear_down</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L112" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_denormalize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L134" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_from_csv_and_from_df</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L54" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_from_folder</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L26" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_from_lists</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L39" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_from_name_re</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L32" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_image_resize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L70" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_multi_iter</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L106" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_multi_iter_broken</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L101" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_normalize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L120" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_path_can_be_str_type</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L22" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>DataBunch suitable for computer vision.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This is the same initialization as a regular <a href="/basic_data.html#DataBunch"><code>DataBunch</code></a> so you probably don't want to use this directly, but one of the factory methods instead.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Factory-methods">Factory methods<a class="anchor-link" href="#Factory-methods">¶</a></h3>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>If you quickly want to get a <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> and train a model, you should process your data to have it in one of the formats the following functions handle.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_folder" class="doc_header"><code>from_folder</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L102" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_folder-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_folder</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>train</code></strong>:<code>PathOrStr</code>=<strong><em><code>'train'</code></em></strong>, <strong><code>valid</code></strong>:<code>PathOrStr</code>=<strong><em><code>'valid'</code></em></strong>, <strong><code>valid_pct</code></strong>=<strong><em><code>None</code></em></strong>, <strong><code>seed</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>classes</code></strong>:<code>Collection</code>[<code>T_co</code>]=<strong><em><code>None</code></em></strong>, <strong>**<code>kwargs</code></strong>:<code>Any</code>) → <code>ImageDataBunch</code></p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_folder-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_folder-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>from_folder</code>:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_from_folder</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L26" class="source_link" style="float:right">[source]</a></li></ul><p>Some other tests where <code>from_folder</code> is used:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_camvid</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L238" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_clean_tear_down</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L112" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_coco</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L267" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_coco_pickle</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L297" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_coco_same_size</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L280" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_denormalize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L134" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_image_resize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L70" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_image_to_image_different_tfms</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L328" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_image_to_image_different_y_size</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L313" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_multi_iter</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L106" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_multi_iter_broken</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L101" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_normalize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L120" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_points</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L254" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_vision_datasets</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L217" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Create from imagenet style dataset in <code>path</code> with <code>train</code>,<code>valid</code>,<code>test</code> subfolders (or provide <code>valid_pct</code>).</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>"<em>Imagenet-style</em>" datasets look something like this (note that the test folder is optional):</p>
<pre><code>path\
train\
clas1\
clas2\
...
valid\
clas1\
clas2\
...
test\</code></pre>
<p>For example:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_folder</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Note that this (and all factory methods in this section) pass any <code>kwargs</code> to <a href="/basic_data.html#DataBunch.create"><code>DataBunch.create</code></a>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_csv" class="doc_header"><code>from_csv</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L122" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_csv-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_csv</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>folder</code></strong>:<code>PathOrStr</code>=<strong><em><code>None</code></em></strong>, <strong><code>label_delim</code></strong>:<code>str</code>=<strong><em><code>None</code></em></strong>, <strong><code>csv_labels</code></strong>:<code>PathOrStr</code>=<strong><em><code>'labels.csv'</code></em></strong>, <strong><code>valid_pct</code></strong>:<code>float</code>=<strong><em><code>0.2</code></em></strong>, <strong><code>seed</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>fn_col</code></strong>:<code>int</code>=<strong><em><code>0</code></em></strong>, <strong><code>label_col</code></strong>:<code>int</code>=<strong><em><code>1</code></em></strong>, <strong><code>suffix</code></strong>:<code>str</code>=<strong><em><code>''</code></em></strong>, <strong><code>delimiter</code></strong>:<code>str</code>=<strong><em><code>None</code></em></strong>, <strong><code>header</code></strong>:<code>Union</code>[<code>int</code>, <code>str</code>, <code>NoneType</code>]=<strong><em><code>'infer'</code></em></strong>, <strong>**<code>kwargs</code></strong>:<code>Any</code>) → <code>ImageDataBunch</code></p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_csv-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_csv-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>from_csv</code>:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_from_csv_and_from_df</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L54" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_path_can_be_str_type</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L22" class="source_link" style="float:right">[source]</a></li></ul><p>Some other tests where <code>from_csv</code> is used:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_multi</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L227" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Create from a csv file in <code>path/csv_labels</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>Create an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> from <code>path</code> by splitting the data in <code>folder</code> and labelled in a file <code>csv_labels</code> between a training and validation set. Use <code>valid_pct</code> to indicate the percentage of the total images to use as the validation set. An optional <code>test</code> folder contains unlabelled data and <code>suffix</code> contains an optional suffix to add to the filenames in <code>csv_labels</code> (such as '.jpg'). <code>fn_col</code> is the index (or the name) of the the column containing the filenames and <code>label_col</code> is the index (indices) (or the name(s)) of the column(s) containing the labels. Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html#pandas-read-csv"><code>header</code></a> to specify the format of the csv header, and <code>delimiter</code> to specify a non-standard csv-field separator. In case your csv has no header, column parameters can only be specified as indices. If <code>label_delim</code> is passed, split what's in the label column according to that separator.</p>
<p>For example:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_csv</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">);</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_df" class="doc_header"><code>from_df</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L113" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_df-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_df</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>df</code></strong>:<code>DataFrame</code>, <strong><code>folder</code></strong>:<code>PathOrStr</code>=<strong><em><code>None</code></em></strong>, <strong><code>label_delim</code></strong>:<code>str</code>=<strong><em><code>None</code></em></strong>, <strong><code>valid_pct</code></strong>:<code>float</code>=<strong><em><code>0.2</code></em></strong>, <strong><code>seed</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>fn_col</code></strong>:<code>IntsOrStrs</code>=<strong><em><code>0</code></em></strong>, <strong><code>label_col</code></strong>:<code>IntsOrStrs</code>=<strong><em><code>1</code></em></strong>, <strong><code>suffix</code></strong>:<code>str</code>=<strong><em><code>''</code></em></strong>, <strong>**<code>kwargs</code></strong>:<code>Any</code>) → <code>ImageDataBunch</code></p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_df-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_df-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>from_df</code>:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_from_csv_and_from_df</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L54" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Create from a <code>DataFrame</code> <code>df</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>Same as <a href="/vision.data.html#ImageDataBunch.from_csv"><code>ImageDataBunch.from_csv</code></a>, but passing in a <code>DataFrame</code> instead of a csv file. e.g</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">path</span><span class="o">/</span><span class="s1">'labels.csv'</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="s1">'infer'</span><span class="p">)</span>
<span class="n">df</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_html rendered_html output_subarea output_execute_result">
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>name</th>
<th>label</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>train/3/7463.png</td>
<td>0</td>
</tr>
<tr>
<th>1</th>
<td>train/3/21102.png</td>
<td>0</td>
</tr>
<tr>
<th>2</th>
<td>train/3/31559.png</td>
<td>0</td>
</tr>
<tr>
<th>3</th>
<td>train/3/46882.png</td>
<td>0</td>
</tr>
<tr>
<th>4</th>
<td>train/3/26209.png</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_df</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">df</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Different datasets are labeled in many different ways. The following methods can help extract the labels from the dataset in a wide variety of situations. The way they are built in fastai is constructive: there are methods which do a lot for you but apply in specific circumstances and there are methods which do less for you but give you more flexibility.</p>
<p>In this case the hierarchy is:</p>
<ol>
<li><a href="/vision.data.html#ImageDataBunch.from_name_re"><code>ImageDataBunch.from_name_re</code></a>: Gets the labels from the filenames using a regular expression</li>
<li><a href="/vision.data.html#ImageDataBunch.from_name_func"><code>ImageDataBunch.from_name_func</code></a>: Gets the labels from the filenames using any function</li>
<li><a href="/vision.data.html#ImageDataBunch.from_lists"><code>ImageDataBunch.from_lists</code></a>: Labels need to be provided as an input in a list</li>
</ol>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_name_re" class="doc_header"><code>from_name_re</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L149" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_name_re-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_name_re</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>fnames</code></strong>:<code>FilePathList</code>, <strong><code>pat</code></strong>:<code>str</code>, <strong><code>valid_pct</code></strong>:<code>float</code>=<strong><em><code>0.2</code></em></strong>, <strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_name_re-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_name_re-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>from_name_re</code>:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_from_name_re</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L32" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_vision_data.py::test_image_resize</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L70" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Create from list of <code>fnames</code> in <code>path</code> with re expression <code>pat</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>Creates an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> from <code>fnames</code>, calling a regular expression (containing one <em>re group</em>) on the file names to get the labels, putting aside <code>valid_pct</code> for the validation. In the same way as <a href="/vision.data.html#ImageDataBunch.from_csv"><code>ImageDataBunch.from_csv</code></a>, an optional <code>test</code> folder contains unlabelled data.</p>
<p>Our previously created dataframe contains the labels in the filenames so we can leverage it to test this new method. <a href="/vision.data.html#ImageDataBunch.from_name_re"><code>ImageDataBunch.from_name_re</code></a> needs the exact path of each file so we will append the data path to each filename before creating our <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> object.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">fn_paths</span> <span class="o">=</span> <span class="p">[</span><span class="n">path</span><span class="o">/</span><span class="n">name</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">df</span><span class="p">[</span><span class="s1">'name'</span><span class="p">]];</span> <span class="n">fn_paths</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>[PosixPath('/home/ubuntu/.fastai/data/mnist_sample/train/3/7463.png'),
PosixPath('/home/ubuntu/.fastai/data/mnist_sample/train/3/21102.png')]</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">pat</span> <span class="o">=</span> <span class="sa">r</span><span class="s2">"/(\d)/\d+\.png$"</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_name_re</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">fn_paths</span><span class="p">,</span> <span class="n">pat</span><span class="o">=</span><span class="n">pat</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data</span><span class="o">.</span><span class="n">classes</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>['3', '7']</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_name_func" class="doc_header"><code>from_name_func</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L142" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_name_func-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_name_func</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>fnames</code></strong>:<code>FilePathList</code>, <strong><code>label_func</code></strong>:<code>Callable</code>, <strong><code>valid_pct</code></strong>:<code>float</code>=<strong><em><code>0.2</code></em></strong>, <strong><code>seed</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_name_func-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_name_func-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>from_name_func</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create from list of <code>fnames</code> in <code>path</code> with <code>label_func</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>Works in the same way as <a href="/vision.data.html#ImageDataBunch.from_name_re"><code>ImageDataBunch.from_name_re</code></a>, but instead of a regular expression it expects a function that will determine how to extract the labels from the filenames. (Note that <code>from_name_re</code> uses this function in its implementation).</p>
<p>To test it we could build a function with our previous regex. Let's try another, similar approach to show that the labels can be obtained in a different way.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="k">def</span> <span class="nf">get_labels</span><span class="p">(</span><span class="n">file_path</span><span class="p">):</span> <span class="k">return</span> <span class="s1">'3'</span> <span class="k">if</span> <span class="s1">'/3/'</span> <span class="ow">in</span> <span class="nb">str</span><span class="p">(</span><span class="n">file_path</span><span class="p">)</span> <span class="k">else</span> <span class="s1">'7'</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_name_func</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">fn_paths</span><span class="p">,</span> <span class="n">label_func</span><span class="o">=</span><span class="n">get_labels</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
<span class="n">data</span><span class="o">.</span><span class="n">classes</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>['3', '7']</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.from_lists" class="doc_header"><code>from_lists</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L132" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-from_lists-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>from_lists</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>fnames</code></strong>:<code>FilePathList</code>, <strong><code>labels</code></strong>:<code>StrList</code>, <strong><code>valid_pct</code></strong>:<code>float</code>=<strong><em><code>0.2</code></em></strong>, <strong><code>seed</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>item_cls</code></strong>:<code>Callable</code>=<strong><em><code>None</code></em></strong>, <strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ImageDataBunch-from_lists-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-from_lists-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>from_lists</code>:</p><ul><li><code>pytest -sv tests/test_vision_data.py::test_from_lists</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_vision_data.py#L39" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Create from list of <code>fnames</code> in <code>path</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Refer to <a href="#ImageDataBunch.create_from_ll"><code>create_from_ll</code></a> to see all the <code>**kwargs</code> arguments.</p>
<p>The most flexible factory function; pass in a list of <code>labels</code> that correspond to each of the filenames in <code>fnames</code>.</p>
<p>To show an example we have to build the labels list outside our <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> object and give it as an argument when we call <code>from_lists</code>. Let's use our previously created function to create our labels list.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">labels_ls</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">get_labels</span><span class="p">,</span> <span class="n">fn_paths</span><span class="p">))</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_lists</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">fn_paths</span><span class="p">,</span> <span class="n">labels</span><span class="o">=</span><span class="n">labels_ls</span><span class="p">,</span> <span class="n">ds_tfms</span><span class="o">=</span><span class="n">tfms</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">24</span><span class="p">)</span>
<span class="n">data</span><span class="o">.</span><span class="n">classes</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>['3', '7']</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.create_from_ll" class="doc_header"><code>create_from_ll</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L89" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-create_from_ll-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>create_from_ll</code>(<strong><code>lls</code></strong>:<a href="/data_block.html#LabelLists"><code>LabelLists</code></a>, <strong><code>bs</code></strong>:<code>int</code>=<strong><em><code>64</code></em></strong>, <strong><code>val_bs</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>ds_tfms</code></strong>:<code>Union</code>[<code>Callable</code>, <code>Collection</code>[<code>Callable</code>], <code>NoneType</code>]=<strong><em><code>None</code></em></strong>, <strong><code>num_workers</code></strong>:<code>int</code>=<strong><em><code>16</code></em></strong>, <strong><code>dl_tfms</code></strong>:<code>Optional</code>[<code>Collection</code>[<code>Callable</code>]]=<strong><em><code>None</code></em></strong>, <strong><code>device</code></strong>:<a href="https://pytorch.org/docs/stable/tensor_attributes.html#torch-device"><code>device</code></a>=<strong><em><code>None</code></em></strong>, <strong><code>test</code></strong>:<code>Union</code>[<code>Path</code>, <code>str</code>, <code>NoneType</code>]=<strong><em><code>None</code></em></strong>, <strong><code>collate_fn</code></strong>:<code>Callable</code>=<strong><em><code>'data_collate'</code></em></strong>, <strong><code>size</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>no_check</code></strong>:<code>bool</code>=<strong><em><code>False</code></em></strong>, <strong><code>resize_method</code></strong>:<a href="/vision.image.html#ResizeMethod"><code>ResizeMethod</code></a>=<strong><em><code>None</code></em></strong>, <strong><code>mult</code></strong>:<code>int</code>=<strong><em><code>None</code></em></strong>, <strong><code>padding_mode</code></strong>:<code>str</code>=<strong><em><code>'reflection'</code></em></strong>, <strong><code>mode</code></strong>:<code>str</code>=<strong><em><code>'bilinear'</code></em></strong>, <strong><code>tfm_y</code></strong>:<code>bool</code>=<strong><em><code>False</code></em></strong>) → <code>ImageDataBunch</code></p>
</blockquote>
<div class="collapse" id="ImageDataBunch-create_from_ll-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-create_from_ll-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>create_from_ll</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create an <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> from <a href="/data_block.html#LabelLists"><code>LabelLists</code></a> <code>lls</code> with potential <code>ds_tfms</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Use <code>bs</code>, <code>num_workers</code>, <code>collate_fn</code> and a potential <code>test</code> folder. <code>ds_tfms</code> is a tuple of two lists of transforms to be applied to the training and the validation (plus test optionally) set. <code>tfms</code> are the transforms to apply to the <a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader"><code>DataLoader</code></a>. The <code>size</code> and the <code>kwargs</code> are passed to the transforms for data augmentation.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ImageDataBunch.single_from_classes" class="doc_header"><code>single_from_classes</code><a href="https://github.com/fastai/fastai/blob/master/fastai/vision/data.py#L160" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ImageDataBunch-single_from_classes-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>single_from_classes</code>(<strong><code>path</code></strong>:<code>PathOrStr</code>, <strong><code>classes</code></strong>:<code>StrList</code>, <strong><code>ds_tfms</code></strong>:<code>Union</code>[<code>Callable</code>, <code>Collection</code>[<code>Callable</code>]]=<strong><em><code>None</code></em></strong>, <strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ImageDataBunch-single_from_classes-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ImageDataBunch-single_from_classes-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>single_from_classes</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create an empty <a href="/vision.data.html#ImageDataBunch"><code>ImageDataBunch</code></a> in <code>path</code> with <code>classes</code>. Typically used for inference.</p>
</div>
</div>
</div>
</div>
</div>