Skip to content

Commit 0488e71

Browse files
committed
use enum for category generation
1 parent 9e5556c commit 0488e71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

torchvision/prototype/datasets/_builtin/dtd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _make_datapipe(
129129
return Mapper(dp, self._collate_and_decode_sample, fn_kwargs=dict(decoder=decoder))
130130

131131
def _filter_images(self, data: Tuple[str, Any]) -> bool:
132-
return self._classify_archive(data) == 2
132+
return self._classify_archive(data) == DTDDemux.IMAGES
133133

134134
def _generate_categories(self, root: pathlib.Path) -> List[str]:
135135
dp = self.resources(self.default_config)[0].load(pathlib.Path(root) / self.name)

torchvision/prototype/datasets/_builtin/oxford_iiit_pet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _make_datapipe(
141141
return Mapper(dp, functools.partial(self._collate_and_decode_sample, decoder=decoder))
142142

143143
def _filter_split_and_classification_anns(self, data: Tuple[str, Any]) -> bool:
144-
return self._classify_anns(data) == 0
144+
return self._classify_anns(data) == OxfordIITPetDemux.SPLIT_AND_CLASSIFICATION
145145

146146
def _generate_categories(self, root: pathlib.Path) -> List[str]:
147147
config = self.default_config

0 commit comments

Comments
 (0)