Skip to content

Commit 6663693

Browse files
YosuaMichaelfacebook-github-bot
authored andcommitted
[fbsync] fix caltech dataset downloads (#5789)
Summary: (Note: this ignores all push blocking failures!) Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095643 fbshipit-source-id: 3165f1891c2760a99ace01fdcee28792028cf20e
1 parent 1937372 commit 6663693

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

torchvision/datasets/caltech.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,15 @@ def download(self) -> None:
129129
return
130130

131131
download_and_extract_archive(
132-
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz",
132+
"https://drive.google.com/file/d/137RyRjvTBkBiIfeYBNZBtViDHQ6_Ewsp",
133133
self.root,
134+
filename="101_ObjectCategories.tar.gz",
134135
md5="b224c7392d521a49829488ab0f1120d9",
135136
)
136137
download_and_extract_archive(
137-
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/Annotations.tar",
138+
"https://drive.google.com/file/d/175kQy3UsZ0wUEHZjqkUDdNVssr7bgh_m",
138139
self.root,
140+
filename="Annotations.tar",
139141
md5="6f83eeb1f24d99cab4eb377263132c91",
140142
)
141143

@@ -228,7 +230,7 @@ def download(self) -> None:
228230
return
229231

230232
download_and_extract_archive(
231-
"http://www.vision.caltech.edu/Image_Datasets/Caltech256/256_ObjectCategories.tar",
233+
"https://drive.google.com/file/d/1r6o0pSROcV1_VwT4oSjA2FBUSCWGuxLK",
232234
self.root,
233235
filename="256_ObjectCategories.tar",
234236
md5="67b4f42ca05d46448c6bb8ecd2220f6d",

torchvision/prototype/datasets/_builtin/caltech.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Filter,
1010
IterKeyZipper,
1111
)
12-
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
12+
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
1313
from torchvision.prototype.datasets.utils._internal import (
1414
INFINITE_BUFFER_SIZE,
1515
read_mat,
@@ -49,13 +49,15 @@ def __init__(
4949
)
5050

5151
def _resources(self) -> List[OnlineResource]:
52-
images = HttpResource(
53-
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz",
52+
images = GDriveResource(
53+
"137RyRjvTBkBiIfeYBNZBtViDHQ6_Ewsp",
54+
file_name="101_ObjectCategories.tar.gz",
5455
sha256="af6ece2f339791ca20f855943d8b55dd60892c0a25105fcd631ee3d6430f9926",
5556
preprocess="decompress",
5657
)
57-
anns = HttpResource(
58-
"http://www.vision.caltech.edu/Image_Datasets/Caltech101/Annotations.tar",
58+
anns = GDriveResource(
59+
"175kQy3UsZ0wUEHZjqkUDdNVssr7bgh_m",
60+
file_name="Annotations.tar",
5961
sha256="1717f4e10aa837b05956e3f4c94456527b143eec0d95e935028b30aff40663d8",
6062
)
6163
return [images, anns]
@@ -171,8 +173,9 @@ def __init__(
171173

172174
def _resources(self) -> List[OnlineResource]:
173175
return [
174-
HttpResource(
175-
"http://www.vision.caltech.edu/Image_Datasets/Caltech256/256_ObjectCategories.tar",
176+
GDriveResource(
177+
"1r6o0pSROcV1_VwT4oSjA2FBUSCWGuxLK",
178+
file_name="256_ObjectCategories.tar",
176179
sha256="08ff01b03c65566014ae88eb0490dbe4419fc7ac4de726ee1163e39fd809543e",
177180
)
178181
]

torchvision/prototype/datasets/_builtin/cub200.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
CSVParser,
1414
CSVDictParser,
1515
)
16-
from torchvision.prototype.datasets.utils import (
17-
Dataset,
18-
HttpResource,
19-
OnlineResource,
20-
)
16+
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
2117
from torchvision.prototype.datasets.utils._internal import (
2218
INFINITE_BUFFER_SIZE,
2319
read_mat,
@@ -71,30 +67,35 @@ def __init__(
7167

7268
def _resources(self) -> List[OnlineResource]:
7369
if self._year == "2011":
74-
archive = HttpResource(
75-
"http://www.vision.caltech.edu/visipedia-data/CUB-200-2011/CUB_200_2011.tgz",
70+
archive = GDriveResource(
71+
"1hbzc_P1FuxMkcabkgn9ZKinBwW683j45",
72+
file_name="CUB_200_2011.tgz",
7673
sha256="0c685df5597a8b24909f6a7c9db6d11e008733779a671760afef78feb49bf081",
7774
preprocess="decompress",
7875
)
79-
segmentations = HttpResource(
80-
"http://www.vision.caltech.edu/visipedia-data/CUB-200-2011/segmentations.tgz",
76+
segmentations = GDriveResource(
77+
"1EamOKGLoTuZdtcVYbHMWNpkn3iAVj8TP",
78+
file_name="segmentations.tgz",
8179
sha256="dc77f6cffea0cbe2e41d4201115c8f29a6320ecb04fffd2444f51b8066e4b84f",
8280
preprocess="decompress",
8381
)
8482
return [archive, segmentations]
8583
else: # self._year == "2010"
86-
split = HttpResource(
87-
"http://www.vision.caltech.edu/visipedia-data/CUB-200/lists.tgz",
84+
split = GDriveResource(
85+
"1vZuZPqha0JjmwkdaS_XtYryE3Jf5Q1AC",
86+
file_name="lists.tgz",
8887
sha256="aeacbd5e3539ae84ea726e8a266a9a119c18f055cd80f3836d5eb4500b005428",
8988
preprocess="decompress",
9089
)
91-
images = HttpResource(
92-
"http://www.vision.caltech.edu/visipedia-data/CUB-200/images.tgz",
90+
images = GDriveResource(
91+
"1GDr1OkoXdhaXWGA8S3MAq3a522Tak-nx",
92+
file_name="images.tgz",
9393
sha256="2a6d2246bbb9778ca03aa94e2e683ccb4f8821a36b7f235c0822e659d60a803e",
9494
preprocess="decompress",
9595
)
96-
anns = HttpResource(
97-
"http://www.vision.caltech.edu/visipedia-data/CUB-200/annotations.tgz",
96+
anns = GDriveResource(
97+
"16NsbTpMs5L6hT4hUJAmpW2u7wH326WTR",
98+
file_name="annotations.tgz",
9899
sha256="c17b7841c21a66aa44ba8fe92369cc95dfc998946081828b1d7b8a4b716805c1",
99100
preprocess="decompress",
100101
)

0 commit comments

Comments
 (0)