Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9457
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit aefaae1 with merge base 4e58149 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @knQzx! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
test/test_transforms_v2.py
Outdated
| cm = pytest.warns(UserWarning, match="deprecated") if f is F.to_tensor else contextlib.nullcontext() | ||
| with cm: | ||
| out = f(I16_pil_img) | ||
| assert out.dtype == torch.int32 |
There was a problem hiding this comment.
hey, thanks for the feedback! updated to use uint16 for both to_tensor and pil_to_tensor. also fixed the failing tests - they were using signed ShortTensor data which doesn't make sense for I;16 (unsigned), so now they generate values in valid range and expect uint16 output
torchvision/transforms/functional.py
Outdated
| if pic.mode == "I;16": | ||
| img = img.astype(np.uint16) |
There was a problem hiding this comment.
I think this part is redundant because np.array(pic, copy=True) on an I;16 PIL image already returns a uint16 array. We can just keep the original code.
d3f956b to
3fbe21e
Compare
|
you're right, removed the redundant astype - np.array already handles it. also rebased on main and added a docs note about uint16/32/64 not being officially supported |
fixes #8188
pil images with I;16 mode use uint16 under the hood which pytorch doesn't support, so this converts them to int32 instead. also fixed the same issue in to_tensor where it was incorrectly using signed int16.