-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pad modifies labels unexpectedly #1015
Comments
Hello For label, the best is to pad with the background label, usually 0 (which is the default if you do not specify the |
Hi Example:
|
ok I see, A solution is to add 2 CropOrPad transform with
adding an explicit argument like |
Thank you both. I've added a warning in |
Is there an existing issue for this?
Problem summary
The Pad class creates new labels when padding_mode='mean'.
This issue could possibly be linked to #626.
Code for reproduction
Actual outcome
tensor([[1., 2.],
[3., 4.]])
tensor([[2.5000, 2.0000, 3.0000, 2.5000],
[1.5000, 1.0000, 2.0000, 1.5000],
[3.5000, 3.0000, 4.0000, 3.5000],
[2.5000, 2.0000, 3.0000, 2.5000]])
Error messages
Expected outcome
I would expect at least a warning. Perhaps another attribute like padding_mode_label could be used to control the mode for LabelMap (limited choices like constant and minimum) while the mode for ScalarImage can be set independently to e.g. 'mean'.
System info
The text was updated successfully, but these errors were encountered: