Skip to content

Fix DTD prototype dataset on Windows #5227

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

Merged
merged 10 commits into from
Jan 31, 2022
3 changes: 2 additions & 1 deletion torchvision/prototype/datasets/_builtin/dtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def _classify_archive(self, data: Tuple[str, Any]) -> Optional[int]:

def _image_key_fn(self, data: Tuple[str, Any]) -> str:
path = pathlib.Path(data[0])
return str(path.relative_to(path.parents[1]))
# The split files contain hardcoded posix paths for the images, e.g. banded/banded_0001.jpg
return str(path.relative_to(path.parents[1]).as_posix())

def _collate_and_decode_sample(
self,
Expand Down