help...Drowning in the source code sea, Can someone tell me size in ImageDataBunch.from_folder(...size=(299, 450)...)

Update

I can now confirm that the size tuple is height by width.
I figured it out by trying display images
data.show_batch(rows=6, figsize=(14,12))

But I still would like to know how to find it through the source code, as finding something through source code will be the daily routine for me to find out my answer quickly in a self-serve manner.


I would like to know the tuple for size parameter, whether it is

width , height
or
height, width

I have been swimming in the source code sea and found myself drowning…
here is my digging path:
ImageDataBunch.from_folder() -> create_from_ll() -> lls.transform(…size=size…) -> self.train.transform(tfms[0], **kwargs) -> I found self.train is ItemList
so I tried to find the self.train.transform(tfms[0], **kwargs) in the Class ItemList and found nothing…

In general, when it comes to numpy, matplotlib, the fastai library, etc. it will always be WxH (hence why there is no width, height etc in the source code, it’s just known). For instance if we are talking an image that’s been converted to a numpy array (so there are 3 channels, RGB): 3x224x225 means an image who is 224 wide by 225 high :slight_smile:

hi @muellerzr

I found the size actually represented by rows * column which is height * width.

Here is how I found it out:

size=(450,299)

size=(299,450)