Tramac / awesome-semantic-segmentation-pytorch

Semantic Segmentation on PyTorch (include FCN, PSPNet, Deeplabv3, Deeplabv3+, DANet, DenseASPP, BiSeNet, EncNet, DUNet, ICNet, ENet, OCNet, CCNet, PSANet, CGNet, ESPNet, LEDNet, DFANet)
Apache License 2.0
2.82k stars 581 forks source link

base_size #88

Open lr1234567 opened 4 years ago

lr1234567 commented 4 years ago

Hello, what is the meaning of base_size=520 and crop_size=480?How do you adapt them to own data set?

pyradd commented 4 years ago

@lr1234567 base size normally refers to the original dimension of the images of your dataset. However, it is important to know that, this repo along with other repo using pytorch normally will crop the image in a square dimension. For example, if your base size is 480, it means the images will be cropped to 480x480. Crop size normally refers to a smaller size than base size that will be used to cropped the images.

Cropping is used to augment your dataset. I dont know what is the diemnsion of your dataset. However, roughly you can choose it as <= the smallest dimension of your dataset. If you have a dataset 2048x1024, your base and crop size can be <=1024. Hope it helps :)

lr1234567 commented 4 years ago

@lr1234567 base size normally refers to the original dimension of the images of your dataset. However, it is important to know that, this repo along with other repo using pytorch normally will crop the image in a square dimension. For example, if your base size is 480, it means the images will be cropped to 480x480. Crop size normally refers to a smaller size than base size that will be used to cropped the images.

Cropping is used to augment your dataset. I dont know what is the diemnsion of your dataset. However, roughly you can choose it as <= the smallest dimension of your dataset. If you have a dataset 2048x1024, your base and crop size can be <=1024. Hope it helps :)

Thank you very much. I have another question,my dataset size is 256*256,but I have set crop size is 480,and base size is 520,both of which are larger than my image size,so why are not any errors?

pyradd commented 4 years ago

If you look into the image transformation function, you will see if your your base size is less than the crop size, it will do zero padding on the border to make it equal to crop size. However, as your dataset is 256×256, your base size will automatically be set to 256. Hope this answers your question. If so, please close the issue. Thanks

lr1234567 commented 4 years ago

Thank you for your reply. My picture is 256*256,crop_size is 480, base_size is 520, if the size of my picture is smaller than the default base_size and crop_size, the default setting will not work?