pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.18k stars 6.95k forks source link

Specifying the output size in transforms.GaussianBlur #8245

Open talcs opened 9 months ago

talcs commented 9 months ago

📚 The doc issue

The transforms.GaussianBlur constructor takes kernel_size as a parameter. However, it isn't specified whether the convolution will use padding to keep the output image in the same dimension as the input. I think it should be mentioned. Maintaining the original input size is crucial in many cases, like object detection or segmentation, where the GT refers to certain pixels.

Suggest a potential alternative/fix

No response

NicolasHug commented 9 months ago

Thanks for the report @talcs . GaussianBlur will indeed use padding:

https://github.com/pytorch/vision/blob/806dba678d5b01f6e8a46f7c48fdf8c09369a267/torchvision/transforms/v2/functional/_misc.py#L152

If you're interested, we'd be happy to review a PR from you to clarify that in the docstring

Bhavay-2001 commented 9 months ago

Hi @NicolasHug, I would be happy to work on this issue. Is it open for beginners? Thanks

NicolasHug commented 9 months ago

Thanks for your interest @Bhavay-2001 , but this has been taken care of in https://github.com/pytorch/vision/pull/8246 already.

Bhavay-2001 commented 9 months ago

Hi @NicolasHug, is there any other issue that I can contribute to? Thanks