Skip to content

Commit 1fb2e3d

Browse files
author
The TensorFlow Datasets Authors
committed
Merge pull request #11074 from SanjaySG:update_caltech_birds_2011
PiperOrigin-RevId: 777746464
2 parents d68c0e0 + 678eebb commit 1fb2e3d

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

tensorflow_datasets/image_classification/caltech_birds.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,14 @@ def process_file(element):
227227
class CaltechBirds2011(CaltechBirds2010):
228228
"""Caltech Birds 2011 dataset."""
229229

230-
VERSION = tfds.core.Version("0.1.1")
230+
VERSION = tfds.core.Version("0.2.0")
231231

232232
@property
233233
def _caltech_birds_info(self):
234-
return CaltechBirdsInfo(
234+
return CaltechBirdsInfo2011(
235235
name=self.name,
236-
images_url="https://drive.google.com/uc?export=download&id=1hbzc_P1FuxMkcabkgn9ZKinBwW683j45",
237-
split_url=None,
238-
annotations_url="https://drive.google.com/uc?export=download&id=1EamOKGLoTuZdtcVYbHMWNpkn3iAVj8TP",
236+
images_url="https://data.caltech.edu/records/65de6-vp158/files/CUB_200_2011.tgz?download=1",
237+
segmentations_url="https://data.caltech.edu/records/w9d68-gec53/files/segmentations.tgz?download=1",
239238
)
240239

241240
def _info(self):
@@ -257,15 +256,13 @@ def _info(self):
257256
)
258257

259258
def _split_generators(self, dl_manager):
260-
download_path = dl_manager.download(
261-
[
262-
self._caltech_birds_info.images_url,
263-
]
264-
)
259+
download_path = dl_manager.download([
260+
self._caltech_birds_info.images_url,
261+
])
265262

266263
extracted_path = dl_manager.download_and_extract([
267264
self._caltech_birds_info.images_url,
268-
self._caltech_birds_info.annotations_url,
265+
self._caltech_birds_info.segmentations_url,
269266
])
270267

271268
image_names_path = os.path.join(
@@ -369,3 +366,18 @@ class CaltechBirdsInfo(
369366
split_url (str): train/test split file URL.
370367
annotations_url (str): annotation folder URL.
371368
"""
369+
370+
371+
class CaltechBirdsInfo2011(
372+
collections.namedtuple(
373+
"_CaltechBirdsInfo2011",
374+
["name", "images_url", "segmentations_url"],
375+
)
376+
):
377+
"""Contains the information necessary to generate a Caltech Birds 2011 dataset.
378+
379+
Attributes:
380+
name (str): name of dataset.
381+
images_url (str): URL containing images
382+
segmentations_url (str): URL containing segmentations.
383+
"""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
https://data.caltech.edu/records/65de6-vp158/files/CUB_200_2011.tgz?download=1 1150585339 0c685df5597a8b24909f6a7c9db6d11e008733779a671760afef78feb49bf081 CUB_200_2011.tgz
2+
https://data.caltech.edu/records/w9d68-gec53/files/segmentations.tgz?download=1 39272883 dc77f6cffea0cbe2e41d4201115c8f29a6320ecb04fffd2444f51b8066e4b84f segmentations.tgz
13
https://drive.google.com/uc?export=download&id=1EamOKGLoTuZdtcVYbHMWNpkn3iAVj8TP 39272883 dc77f6cffea0cbe2e41d4201115c8f29a6320ecb04fffd2444f51b8066e4b84f segmentations.tgz
24
https://drive.google.com/uc?export=download&id=1hbzc_P1FuxMkcabkgn9ZKinBwW683j45 1150585339 0c685df5597a8b24909f6a7c9db6d11e008733779a671760afef78feb49bf081 CUB_200_2011.tgz

0 commit comments

Comments
 (0)