Lesson 3 - Official Topic

<3 Thanks for adding an 8th lesson! Much appreciated!

3 Likes

What are the advantages of having square images vs rectangular ones?

4 Likes

You probably have as many talls images as you have wide images, so resizing to a square is kind of the mean point.

5 Likes

Why are images usually squished to squares? I would think that the expected aspect ratio would be best

When you use the dls.new method, what can and cannot be changed? Is it just the transforms?

6 Likes

How to ensure that the feature is not lost during crop/resize?

2 Likes

Just item_tfms and batch_tfms yes, here is the signautre:

def new(self, item_tfms=None, batch_tfms=None):
6 Likes

In general you have to look at a lot of images if you want to make sure nothing important is accidentally cropped out. Typically I’ll use .show_batch() and investigate a few batches.

4 Likes

Can qw have multiple item_tfms applied to the same dataset and create a larger dataset. How do you concatenate multiple item_tfms and does the order matter ?

How can we visualize the images after we perform the data augmentation in the batches?
if I start with 100 images, will it add more images? How can I visualize all these new images.

item_tfms do not create a bigger dataset. If you pass multiple ones, they are composed. You still have the same number of images in your dataset.

1 Like

dls.show_batch() will always show you the augmented version.

4 Likes

Why item_tfms and batch_tfms why not just batch_tfms ? Since all transforms are on the individual images.Or am i missing something?

Thanks, how many more pictures will add to our dataloader?

No. As their name indicates, batch_tfms are applied to a batch of images at a time.

We look at the DataBlock source code at Source Code study group and created videos for each session.

https://forums.fast.ai/t/source-code-mid-level-api/65755

This forum post also contains multiple exmaple of DataBlock API including reading four channel images/multilabel audio/5 different single image single label similar to bears and pets examples.

10 Likes

Is the idea of randomResizedCrop that you’ll make multiple copies of the same photo with different parts/versions included all at once? Or are you randomResizing every photo once?

1 Like

None. You still have the same pictures. What a transform might do (if it does data augmentation) is to return a different result each time you ask for the image. But transforms do not add new raw items (aka new filenames).

2 Likes

Can you use methods like RandomResizedCrop to increase the size of your training set?

thank you so much