Right strategy for cropping/resizing images

Hi Everyone,

I have a dataset which consists of necklines (v-neck, round neck, etc), so the area of concern is in top upper half of the image. Therefore, I cropped the images using the line below and saved them:

neck = img.crop((0, 0, width, 0.65*height))

Now, when I create the data loader using fastai:, I set the crop type to NO:

tfms = tfms_from_model(arch, sz,aug_tfms=transforms_side_on, max_zoom=1.1,crop_type=CropType.NO)
data = ImageClassifierData.from_paths(path, bs=bs, tfms=tfms, num_workers=1) 

Looking into the fastai code, I found that when the crop type is set to NO, the image is still resized to be a square image, so my cropped images are all 224 X 224. My question is whether this is the right way to deal with this kind of a dataset? What is the difference between my current strategy and resizing the images first and then cropping? Does resizing not distort the image - does that affect the CNN’s accuracy?

1 Like