Unverified Commit 32df801a authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix Caltech datasets (#4556)


Co-authored-by: default avatarPrabhat Roy <prabhatroy@fb.com>
parent 403bded3
......@@ -133,13 +133,11 @@ class Caltech101(VisionDataset):
download_and_extract_archive(
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz",
self.root,
filename="101_ObjectCategories.tar.gz",
md5="b224c7392d521a49829488ab0f1120d9",
)
download_and_extract_archive(
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/Annotations.tar",
self.root,
filename="101_Annotations.tar",
md5="6f83eeb1f24d99cab4eb377263132c91",
)
......@@ -184,7 +182,13 @@ class Caltech256(VisionDataset):
self.index: List[int] = []
self.y = []
for (i, c) in enumerate(self.categories):
n = len(os.listdir(os.path.join(self.root, "256_ObjectCategories", c)))
n = len(
[
item
for item in os.listdir(os.path.join(self.root, "256_ObjectCategories", c))
if item.endswith(".jpg")
]
)
self.index.extend(range(1, n + 1))
self.y.extend(n * [i])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment