fix resize_mask ignoring NEAREST_EXACT interpolation#9384
fix resize_mask ignoring NEAREST_EXACT interpolation#9384Mr-Neutr0n wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9384
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 New FailuresAs of commit 177f66e with merge base 0f6d91d ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@Mr-Neutr0n Hi, Thanks a lot for creating the PR. I am reviewing it. At the same time, could you please take a look at the test errors and address those? |
|
I took a look at the test errors and wanted to share a few observations: a, the signature order does not match F.resize: resize_mask(mask, size, max_size, interpolation) should be resize_mask(mask, size, interpolation, max_size). If you have any questions while addressing the CI test failures, please feel free to reach out. |
Fixes #9188
resize_mask()was hardcodingInterpolationMode.NEARESTand ignoring the user-specified interpolation mode entirely. This meantNEAREST_EXACT(which is the more correct interpolation — matching PIL and scikit-image behavior) got silently dropped when resizing atv_tensors.Mask.The fix adds an
interpolationparameter toresize_mask()and passes it through from the dispatch function. OnlyNEARESTandNEAREST_EXACTare accepted — anything else (bilinear, bicubic, etc.) falls back toNEARESTsince those don't make sense for masks.