toy loading script
Browse files- Birdsnap.py +6 -5
Birdsnap.py
CHANGED
|
@@ -45,7 +45,7 @@ _HOMEPAGE = ""
|
|
| 45 |
# TODO: Add the licence for the dataset here if you can find it
|
| 46 |
_LICENSE = ""
|
| 47 |
|
| 48 |
-
_URL = {"images": "images/{archive_name}", "annotations": "annotations.tar.gz"}
|
| 49 |
# "http://thomasberg.org/datasets/birdsnap/1.1/birdsnap.tgz"
|
| 50 |
|
| 51 |
_IMAGES_ARCHIVES = [
|
|
@@ -3002,12 +3002,13 @@ class BirdsnapDataset(datasets.GeneratorBasedBuilder):
|
|
| 3002 |
)
|
| 3003 |
|
| 3004 |
def _split_generators(self, dl_manager):
|
| 3005 |
-
_URL["images"] =
|
| 3006 |
_URL["images"].format(archive_name=archive_name)
|
| 3007 |
-
for archive_name in _IMAGES_ARCHIVES
|
| 3008 |
-
|
| 3009 |
|
| 3010 |
-
data_dir = dl_manager.
|
|
|
|
| 3011 |
images_dir = Path(data_dir["images"]) / "images"
|
| 3012 |
annotations_dir = Path(data_dir["annotations"])
|
| 3013 |
with open(annotations_dir / "test_images.txt", "r") as f:
|
|
|
|
| 45 |
# TODO: Add the licence for the dataset here if you can find it
|
| 46 |
_LICENSE = ""
|
| 47 |
|
| 48 |
+
_URL = {"images_test": "images/Acadian_Flycatcher.tar.gz", "images": "images/{archive_name}", "annotations": "annotations.tar.gz"}
|
| 49 |
# "http://thomasberg.org/datasets/birdsnap/1.1/birdsnap.tgz"
|
| 50 |
|
| 51 |
_IMAGES_ARCHIVES = [
|
|
|
|
| 3002 |
)
|
| 3003 |
|
| 3004 |
def _split_generators(self, dl_manager):
|
| 3005 |
+
_URL["images"] = {archive_name:
|
| 3006 |
_URL["images"].format(archive_name=archive_name)
|
| 3007 |
+
for archive_name in _IMAGES_ARCHIVES[:4] #TODO change, reduced hare to play with it
|
| 3008 |
+
}
|
| 3009 |
|
| 3010 |
+
data_dir = dl_manager.download(_URL)
|
| 3011 |
+
data_dir = dl_manager.extract(data_dir)
|
| 3012 |
images_dir = Path(data_dir["images"]) / "images"
|
| 3013 |
annotations_dir = Path(data_dir["annotations"])
|
| 3014 |
with open(annotations_dir / "test_images.txt", "r") as f:
|