Another attempt for classes file download.
Browse files- bird-data.py +3 -2
bird-data.py
CHANGED
|
@@ -31,19 +31,20 @@ _URLS = {
|
|
| 31 |
"test": f"{_REPO}/data/test.zip",
|
| 32 |
}
|
| 33 |
|
| 34 |
-
|
| 35 |
|
| 36 |
class Beans(datasets.GeneratorBasedBuilder):
|
| 37 |
"""Beans plant leaf images dataset."""
|
| 38 |
|
| 39 |
def _info(self):
|
|
|
|
| 40 |
return datasets.DatasetInfo(
|
| 41 |
description=_DESCRIPTION,
|
| 42 |
features=datasets.Features(
|
| 43 |
{
|
| 44 |
"image_file_path": datasets.Value("string"),
|
| 45 |
"image": datasets.Image(),
|
| 46 |
-
"labels": datasets.features.ClassLabel(names_file=
|
| 47 |
}
|
| 48 |
),
|
| 49 |
supervised_keys=("image", "labels"),
|
|
|
|
| 31 |
"test": f"{_REPO}/data/test.zip",
|
| 32 |
}
|
| 33 |
|
| 34 |
+
_CLASSES_URL = f"{_REPO}/classes.txt"
|
| 35 |
|
| 36 |
class Beans(datasets.GeneratorBasedBuilder):
|
| 37 |
"""Beans plant leaf images dataset."""
|
| 38 |
|
| 39 |
def _info(self):
|
| 40 |
+
names_file = dl_manager.download(_CLASSES_URL)
|
| 41 |
return datasets.DatasetInfo(
|
| 42 |
description=_DESCRIPTION,
|
| 43 |
features=datasets.Features(
|
| 44 |
{
|
| 45 |
"image_file_path": datasets.Value("string"),
|
| 46 |
"image": datasets.Image(),
|
| 47 |
+
"labels": datasets.features.ClassLabel(names_file=names_file),
|
| 48 |
}
|
| 49 |
),
|
| 50 |
supervised_keys=("image", "labels"),
|