Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions torchvision/datasets/celeba.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def __getitem__(self, index: int) -> tuple[Any, Any]:

target: Any = []
for t in self.target_type:
t = verify_str_arg(t, arg="target_type", valid_values=["attr", "identity", "bbox", "landmarks"])
if t == "attr":
target.append(self.attr[index, :])
elif t == "identity":
Expand All @@ -185,9 +186,6 @@ def __getitem__(self, index: int) -> tuple[Any, Any]:
target.append(self.bbox[index, :])
elif t == "landmarks":
target.append(self.landmarks_align[index, :])
else:
# TODO: refactor with utils.verify_str_arg
raise ValueError(f'Target type "{t}" is not recognized.')

if self.transform is not None:
X = self.transform(X)
Expand Down