Datasets:
Tasks:
Image Classification
Formats:
parquet
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
1K - 10K
License:
Update files from the datasets library (from 1.17.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.17.0
- README.md +2 -0
- beans.py +4 -5
- dataset_infos.json +1 -1
README.md
CHANGED
@@ -76,6 +76,7 @@ A sample from the training set is provided below:
|
|
76 |
```
|
77 |
{
|
78 |
'image_file_path': '/root/.cache/huggingface/datasets/downloads/extracted/0aaa78294d4bf5114f58547e48d91b7826649919505379a167decb629aa92b0a/train/bean_rust/bean_rust_train.109.jpg',
|
|
|
79 |
'labels': 1
|
80 |
}
|
81 |
```
|
@@ -85,6 +86,7 @@ A sample from the training set is provided below:
|
|
85 |
The data instances have the following fields:
|
86 |
|
87 |
- `image_file_path`: a `string` filepath to an image.
|
|
|
88 |
- `labels`: an `int` classification label.
|
89 |
|
90 |
Class Label Mappings:
|
|
|
76 |
```
|
77 |
{
|
78 |
'image_file_path': '/root/.cache/huggingface/datasets/downloads/extracted/0aaa78294d4bf5114f58547e48d91b7826649919505379a167decb629aa92b0a/train/bean_rust/bean_rust_train.109.jpg',
|
79 |
+
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x500 at 0x16BAA72A4A8>,
|
80 |
'labels': 1
|
81 |
}
|
82 |
```
|
|
|
86 |
The data instances have the following fields:
|
87 |
|
88 |
- `image_file_path`: a `string` filepath to an image.
|
89 |
+
- `image`: A `PIL.Image.Image` object containing the image. Note that when accessing the image column: `dataset[0]["image"]` the image file is automatically decoded. Decoding of a large number of image files might take a significant amount of time. Thus it is important to first query the sample index before the `"image"` column, *i.e.* `dataset[0]["image"]` should **always** be preferred over `dataset["image"][0]`.
|
90 |
- `labels`: an `int` classification label.
|
91 |
|
92 |
Class Label Mappings:
|
beans.py
CHANGED
@@ -58,15 +58,14 @@ class Beans(datasets.GeneratorBasedBuilder):
|
|
58 |
features=datasets.Features(
|
59 |
{
|
60 |
"image_file_path": datasets.Value("string"),
|
|
|
61 |
"labels": datasets.features.ClassLabel(names=_NAMES),
|
62 |
}
|
63 |
),
|
64 |
-
supervised_keys=("
|
65 |
homepage=_HOMEPAGE,
|
66 |
citation=_CITATION,
|
67 |
-
task_templates=[
|
68 |
-
ImageClassification(image_file_path_column="image_file_path", label_column="labels", labels=_NAMES)
|
69 |
-
],
|
70 |
)
|
71 |
|
72 |
def _split_generators(self, dl_manager):
|
@@ -95,4 +94,4 @@ class Beans(datasets.GeneratorBasedBuilder):
|
|
95 |
def _generate_examples(self, archive):
|
96 |
for i, path in enumerate(Path(archive).glob("**/*")):
|
97 |
if path.suffix == ".jpg":
|
98 |
-
yield i,
|
|
|
58 |
features=datasets.Features(
|
59 |
{
|
60 |
"image_file_path": datasets.Value("string"),
|
61 |
+
"image": datasets.Image(),
|
62 |
"labels": datasets.features.ClassLabel(names=_NAMES),
|
63 |
}
|
64 |
),
|
65 |
+
supervised_keys=("image", "labels"),
|
66 |
homepage=_HOMEPAGE,
|
67 |
citation=_CITATION,
|
68 |
+
task_templates=[ImageClassification(image_column="image", label_column="labels", labels=_NAMES)],
|
|
|
|
|
69 |
)
|
70 |
|
71 |
def _split_generators(self, dl_manager):
|
|
|
94 |
def _generate_examples(self, archive):
|
95 |
for i, path in enumerate(Path(archive).glob("**/*")):
|
96 |
if path.suffix == ".jpg":
|
97 |
+
yield i, {"image_file_path": str(path), "image": str(path), "labels": path.parent.name.lower()}
|
dataset_infos.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"default": {"description": "Beans is a dataset of images of beans taken in the field using smartphone\ncameras. It consists of 3 classes: 2 disease classes and the healthy class.\nDiseases depicted include Angular Leaf Spot and Bean Rust. Data was annotated\nby experts from the National Crops Resources Research Institute (NaCRRI) in\nUganda and collected by the Makerere AI research lab.\n", "citation": "@ONLINE {beansdata,\n author=\"Makerere AI Lab\",\n title=\"Bean disease dataset\",\n month=\"January\",\n year=\"2020\",\n url=\"https://github.com/AI-Lab-Makerere/ibean/\"\n}\n", "homepage": "https://github.com/AI-Lab-Makerere/ibean/", "license": "", "features": {"image_file_path": {"dtype": "string", "id": null, "_type": "Value"}, "labels": {"num_classes": 3, "names": ["angular_leaf_spot", "bean_rust", "healthy"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "
|
|
|
1 |
+
{"default": {"description": "Beans is a dataset of images of beans taken in the field using smartphone\ncameras. It consists of 3 classes: 2 disease classes and the healthy class.\nDiseases depicted include Angular Leaf Spot and Bean Rust. Data was annotated\nby experts from the National Crops Resources Research Institute (NaCRRI) in\nUganda and collected by the Makerere AI research lab.\n", "citation": "@ONLINE {beansdata,\n author=\"Makerere AI Lab\",\n title=\"Bean disease dataset\",\n month=\"January\",\n year=\"2020\",\n url=\"https://github.com/AI-Lab-Makerere/ibean/\"\n}\n", "homepage": "https://github.com/AI-Lab-Makerere/ibean/", "license": "", "features": {"image_file_path": {"dtype": "string", "id": null, "_type": "Value"}, "image": {"id": null, "_type": "Image"}, "labels": {"num_classes": 3, "names": ["angular_leaf_spot", "bean_rust", "healthy"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "image", "output": "labels"}, "task_templates": [{"task": "image-classification", "image_column": "image", "label_column": "labels", "labels": ["angular_leaf_spot", "bean_rust", "healthy"]}], "builder_name": "beans", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 373830, "num_examples": 1034, "dataset_name": "beans"}, "validation": {"name": "validation", "num_bytes": 48639, "num_examples": 133, "dataset_name": "beans"}, "test": {"name": "test", "num_bytes": 45552, "num_examples": 128, "dataset_name": "beans"}}, "download_checksums": {"https://storage.googleapis.com/ibeans/train.zip": {"num_bytes": 143812152, "checksum": "284fe8456ce20687f4367ae7ad94a64577e7f9fde2c2c6b1c74340ab5dc82715"}, "https://storage.googleapis.com/ibeans/validation.zip": {"num_bytes": 18504213, "checksum": "90b7aa1c26d91d9afff07a30bbc67a5ea34f1f1397f068d8675be09d7d0c602d"}, "https://storage.googleapis.com/ibeans/test.zip": {"num_bytes": 17708541, "checksum": "ca67b15d960d1e2fd9d23fd8498ce86818ead90755c630a43baf19ec4af09312"}}, "download_size": 180024906, "post_processing_size": null, "dataset_size": 468021, "size_in_bytes": 180492927}}
|