Datasets:

Tasks:
Other
Languages: English
Multilinguality: monolingual
Size Categories: 1K<n<10K
Language Creators: expert-generated
Annotations Creators: expert-generated
Source Datasets: original
License:
yourusername commited on
Commit
241a33d
0 Parent(s):

:tada: init

Browse files
Files changed (3) hide show
  1. README.md +165 -0
  2. beans.py +101 -0
  3. dataset_infos.json +1 -0
README.md ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - expert-generated
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - mit
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: Beans
13
+ size_categories:
14
+ - 1K<n<10K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - other
19
+ task_ids:
20
+ - other-other-image-classification
21
+ ---
22
+
23
+ # Dataset Card for Beans
24
+
25
+ ## Table of Contents
26
+ - [Table of Contents](#table-of-contents)
27
+ - [Dataset Description](#dataset-description)
28
+ - [Dataset Summary](#dataset-summary)
29
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
30
+ - [Languages](#languages)
31
+ - [Dataset Structure](#dataset-structure)
32
+ - [Data Instances](#data-instances)
33
+ - [Data Fields](#data-fields)
34
+ - [Data Splits](#data-splits)
35
+ - [Dataset Creation](#dataset-creation)
36
+ - [Curation Rationale](#curation-rationale)
37
+ - [Source Data](#source-data)
38
+ - [Annotations](#annotations)
39
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
40
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
41
+ - [Social Impact of Dataset](#social-impact-of-dataset)
42
+ - [Discussion of Biases](#discussion-of-biases)
43
+ - [Other Known Limitations](#other-known-limitations)
44
+ - [Additional Information](#additional-information)
45
+ - [Dataset Curators](#dataset-curators)
46
+ - [Licensing Information](#licensing-information)
47
+ - [Citation Information](#citation-information)
48
+ - [Contributions](#contributions)
49
+
50
+ ## Dataset Description
51
+
52
+ - **Homepage:**[Beans Homepage](https://github.com/AI-Lab-Makerere/ibean/)
53
+ - **Repository:**[AI-Lab-Makerere/ibean](https://github.com/AI-Lab-Makerere/ibean/)
54
+ - **Paper:** N/A
55
+ - **Leaderboard:** N/A
56
+ - **Point of Contact:** N/A
57
+
58
+ ### Dataset Summary
59
+
60
+ Beans leaf dataset with images of diseased and health leaves.
61
+
62
+ ### Supported Tasks and Leaderboards
63
+
64
+ - image-classification
65
+
66
+ ### Languages
67
+
68
+ English
69
+
70
+ ## Dataset Structure
71
+
72
+ ### Data Instances
73
+
74
+ A sample from the training set is provided below:
75
+
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
+ ```
82
+
83
+ ### Data Fields
84
+
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
+ ### Data Splits
91
+
92
+
93
+ | name |train|validation|test|
94
+ |----------|----:|----:|----:|
95
+ |beans|1034|133|128|
96
+
97
+ ## Dataset Creation
98
+
99
+ ### Curation Rationale
100
+
101
+ [More Information Needed]
102
+
103
+ ### Source Data
104
+
105
+ #### Initial Data Collection and Normalization
106
+
107
+ [More Information Needed]
108
+
109
+ #### Who are the source language producers?
110
+
111
+ [More Information Needed]
112
+
113
+ ### Annotations
114
+
115
+ #### Annotation process
116
+
117
+ [More Information Needed]
118
+
119
+ #### Who are the annotators?
120
+
121
+ [More Information Needed]
122
+
123
+ ### Personal and Sensitive Information
124
+
125
+ [More Information Needed]
126
+
127
+ ## Considerations for Using the Data
128
+
129
+ ### Social Impact of Dataset
130
+
131
+ [More Information Needed]
132
+
133
+ ### Discussion of Biases
134
+
135
+ [More Information Needed]
136
+
137
+ ### Other Known Limitations
138
+
139
+ [More Information Needed]
140
+
141
+ ## Additional Information
142
+
143
+ ### Dataset Curators
144
+
145
+ [More Information Needed]
146
+
147
+ ### Licensing Information
148
+
149
+ [More Information Needed]
150
+
151
+ ### Citation Information
152
+
153
+ ```
154
+ @ONLINE {beansdata,
155
+ author="Makerere AI Lab",
156
+ title="Bean disease dataset",
157
+ month="January",
158
+ year="2020",
159
+ url="https://github.com/AI-Lab-Makerere/ibean/"
160
+ }
161
+ ```
162
+
163
+ ### Contributions
164
+
165
+ Thanks to [@nateraw](https://github.com/nateraw) for adding this dataset.
beans.py ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """Beans leaf dataset with images of diseased and health leaves."""
16
+
17
+ from pathlib import Path
18
+
19
+ import datasets
20
+ from datasets.tasks import ImageClassification
21
+
22
+
23
+ _HOMEPAGE = "https://github.com/AI-Lab-Makerere/ibean/"
24
+
25
+ _CITATION = """\
26
+ @ONLINE {beansdata,
27
+ author="Makerere AI Lab",
28
+ title="Bean disease dataset",
29
+ month="January",
30
+ year="2020",
31
+ url="https://github.com/AI-Lab-Makerere/ibean/"
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ Beans is a dataset of images of beans taken in the field using smartphone
37
+ cameras. It consists of 3 classes: 2 disease classes and the healthy class.
38
+ Diseases depicted include Angular Leaf Spot and Bean Rust. Data was annotated
39
+ by experts from the National Crops Resources Research Institute (NaCRRI) in
40
+ Uganda and collected by the Makerere AI research lab.
41
+ """
42
+
43
+ _URLS = {
44
+ "train": "https://storage.googleapis.com/ibeans/train.zip",
45
+ "validation": "https://storage.googleapis.com/ibeans/validation.zip",
46
+ "test": "https://storage.googleapis.com/ibeans/test.zip",
47
+ }
48
+
49
+ _NAMES = ["angular_leaf_spot", "bean_rust", "healthy"]
50
+
51
+
52
+ class Beans(datasets.GeneratorBasedBuilder):
53
+ """Beans plant leaf images dataset."""
54
+
55
+ def _info(self):
56
+ return datasets.DatasetInfo(
57
+ description=_DESCRIPTION,
58
+ features=datasets.Features(
59
+ {
60
+ "image_file_path": datasets.Value("string"),
61
+ "labels": datasets.features.ClassLabel(names=sorted(tuple(_NAMES))),
62
+ }
63
+ ),
64
+ supervised_keys=("image_file_path", "labels"),
65
+ homepage=_HOMEPAGE,
66
+ citation=_CITATION,
67
+ task_templates=[
68
+ ImageClassification(
69
+ image_file_path_column="image_file_path", label_column="labels", labels=sorted(tuple(_NAMES))
70
+ )
71
+ ],
72
+ )
73
+
74
+ def _split_generators(self, dl_manager):
75
+ data_files = dl_manager.download_and_extract(_URLS)
76
+ return [
77
+ datasets.SplitGenerator(
78
+ name=datasets.Split.TRAIN,
79
+ gen_kwargs={
80
+ "archive": data_files["train"],
81
+ },
82
+ ),
83
+ datasets.SplitGenerator(
84
+ name=datasets.Split.VALIDATION,
85
+ gen_kwargs={
86
+ "archive": data_files["validation"],
87
+ },
88
+ ),
89
+ datasets.SplitGenerator(
90
+ name=datasets.Split.TEST,
91
+ gen_kwargs={
92
+ "archive": data_files["test"],
93
+ },
94
+ ),
95
+ ]
96
+
97
+ def _generate_examples(self, archive):
98
+ labels = self.info.features["labels"]
99
+ for i, path in enumerate(Path(archive).glob("**/*")):
100
+ if path.suffix == ".jpg":
101
+ yield i, dict(image_file_path=str(path), labels=labels.encode_example(path.parent.name.lower()))
dataset_infos.json ADDED
@@ -0,0 +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": "image_file_path", "output": "labels"}, "task_templates": [{"task": "image-classification", "image_file_path_column": "image_file_path", "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": 188916, "num_examples": 1034, "dataset_name": "beans"}, "validation": {"name": "validation", "num_bytes": 24575, "num_examples": 133, "dataset_name": "beans"}, "test": {"name": "test", "num_bytes": 23022, "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": 236513, "size_in_bytes": 180261419}}