-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add pathlib.Path support to read_image #2962
Comments
@Yura52 thanks for the feature request. This seems reasonable, however there could be a blocker if we would like to use it with torchscript. We have to check. |
As @vfdev-5 mentioned, we would like to support As you mentioned, this could be probably easily done by casting internally to vision/torchvision/io/image.py Line 61 in 32e5700
vision/torchvision/io/image.py Line 74 in 32e5700
and adding something like path = str(path) before the function calls. |
Any news on this front? |
+1 support for this please |
would be nice to have. |
I believe this was addressed by #8314 |
When I try to pass an object of
pathlib.Path
totorchvision.io.read_image
, I get:Casting the object to
str
fixes the problem. It would be nice to support the usual set of "path-like" types as input (str, bytes, pathlib.Path, ...)The text was updated successfully, but these errors were encountered: