system HF staff commited on
Commit
63a0e4e
0 Parent(s):

Update files from the datasets library (from 1.18.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.18.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +220 -0
  3. cppe-5.py +134 -0
  4. dataset_infos.json +1 -0
  5. dummy/1.0.0/dummy_data.zip +3 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - other
18
+ task_ids:
19
+ - other-other-object-detection
20
+ paperswithcode_id: cppe-5
21
+ pretty_name: CPPE - 5
22
+ ---
23
+
24
+ # Dataset Card for CPPE - 5
25
+
26
+ ## Table of Contents
27
+ - [Table of Contents](#table-of-contents)
28
+ - [Dataset Description](#dataset-description)
29
+ - [Dataset Summary](#dataset-summary)
30
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
31
+ - [Languages](#languages)
32
+ - [Dataset Structure](#dataset-structure)
33
+ - [Data Instances](#data-instances)
34
+ - [Data Fields](#data-fields)
35
+ - [Data Splits](#data-splits)
36
+ - [Dataset Creation](#dataset-creation)
37
+ - [Curation Rationale](#curation-rationale)
38
+ - [Source Data](#source-data)
39
+ - [Annotations](#annotations)
40
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
41
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
42
+ - [Social Impact of Dataset](#social-impact-of-dataset)
43
+ - [Discussion of Biases](#discussion-of-biases)
44
+ - [Other Known Limitations](#other-known-limitations)
45
+ - [Additional Information](#additional-information)
46
+ - [Dataset Curators](#dataset-curators)
47
+ - [Licensing Information](#licensing-information)
48
+ - [Citation Information](#citation-information)
49
+ - [Contributions](#contributions)
50
+
51
+ ## Dataset Description
52
+
53
+ - **Homepage:**
54
+ - **Repository:** https://github.com/Rishit-dagli/CPPE-Dataset
55
+ - **Paper:** [CPPE-5: Medical Personal Protective Equipment Dataset](https://arxiv.org/abs/2112.09569)
56
+ - **Leaderboard:** https://paperswithcode.com/sota/object-detection-on-cppe-5
57
+ - **Point of Contact:** rishit.dagli@gmail.com
58
+
59
+ ### Dataset Summary
60
+
61
+ CPPE - 5 (Medical Personal Protective Equipment) is a new challenging dataset with the goal to allow the study of subordinate categorization of medical personal protective equipments, which is not possible with other popular data sets that focus on broad level categories.
62
+
63
+ Some features of this dataset are:
64
+
65
+ * high quality images and annotations (~4.6 bounding boxes per image)
66
+ * real-life images unlike any current such dataset
67
+ * majority of non-iconic images (allowing easy deployment to real-world environments)
68
+
69
+ ### Supported Tasks and Leaderboards
70
+
71
+ - `object-detection`: The dataset can be used to train a model for Object Detection. This task has an active leaderboard which can be found at https://paperswithcode.com/sota/object-detection-on-cppe-5. The metrics for this task are adopted from the COCO detection evaluation criteria, and include the mean Average Precision (AP) across IoU thresholds ranging from 0.50 to 0.95 at different scales.
72
+
73
+ ### Languages
74
+
75
+ English
76
+
77
+ ## Dataset Structure
78
+
79
+ ### Data Instances
80
+
81
+ A data point comprises an image and its object annotations.
82
+
83
+ ```
84
+ {
85
+ 'image_id': 15,
86
+ 'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=943x663 at 0x2373B065C18>,
87
+ 'width': 943,
88
+ 'height': 663,
89
+ 'objects': {
90
+ 'id': [114, 115, 116, 117],
91
+ 'area': [3796, 1596, 152768, 81002],
92
+ 'bbox': [
93
+ [302.0, 109.0, 73.0, 52.0],
94
+ [810.0, 100.0, 57.0, 28.0],
95
+ [160.0, 31.0, 248.0, 616.0],
96
+ [741.0, 68.0, 202.0, 401.0]
97
+ ],
98
+ 'category': [4, 4, 0, 0]
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Data Fields
104
+
105
+ - `image`: the image id
106
+ - `image`: `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]`
107
+ - `width`: the image width
108
+ - `height`: the image height
109
+ - `objects`: a dictionary containing bounding box metadata for the objects present on the image
110
+ - `id`: the annotation id
111
+ - `area`: the area of the bounding box
112
+ - `bbox`: the object's bounding box (in the [coco](https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/#coco) format)
113
+ - `category`: the object's category, with possible values including `Coverall` (0),`Face_Shield` (1),`Gloves` (2),`Goggles` (3) and `Mask` (4)
114
+
115
+ ### Data Splits
116
+
117
+ The data is split into training and testing set. The training set contains 1000 images and test set 29 images.
118
+
119
+ ## Dataset Creation
120
+
121
+ ### Curation Rationale
122
+
123
+ From the paper:
124
+ > With CPPE-5 dataset, we hope to facilitate research and use in applications at multiple public places to autonomously identify if a PPE (Personal Protective Equipment) kit has been worn and also which part of the PPE kit has been worn. One of the main aims with this dataset was to also capture a higher ratio of non-iconic images or non-canonical perspectives [5] of the objects in this dataset. We further hope to see high use of this dataset to aid in medical scenarios which would have a huge effect
125
+ worldwide.
126
+
127
+ ### Source Data
128
+
129
+ #### Initial Data Collection and Normalization
130
+
131
+ The images in the CPPE-5 dataset were collected using the following process:
132
+ * Obtain Images from Flickr: Following the object categories we identified earlier, we first download images from Flickr and save them at the "Original" size. On Flickr, images are served at multiple different sizes (Square 75, Small 240, Large 1024, X-Large 4K etc.), the "Original" size is an exact copy of the image uploaded by author.
133
+ * Extract relevant metadata: Flickr contains images each with searchable metadata, we extract the following relevant
134
+ metadata:
135
+ * A direct link to the original image on Flickr
136
+ * Width and height of the image
137
+ * Title given to the image by the author
138
+ * Date and time the image was uploaded on
139
+ * Flickr username of the author of the image
140
+ * Flickr Name of the author of the image
141
+ * Flickr profile of the author of the image
142
+ * The License image is licensed under
143
+ * MD5 hash of the original image
144
+ * Obtain Images from Google Images: Due to the reasons we mention earlier, we only collect a very small proportion
145
+ of images from Google Images. For these set of images we extract the following metadata:
146
+ * A direct link to the original image
147
+ * Width and height of the image
148
+ * MD5 hash of the original image
149
+ * Filter inappropriate images: Though very rare in the collected images, we also remove images containing inappropriate content using the safety filters on Flickr and Google Safe Search.
150
+ * Filter near-similar images: We then remove near-duplicate images in the dataset using GIST descriptors
151
+
152
+ #### Who are the source language producers?
153
+
154
+ The images for this dataset were collected from Flickr and Google Images.
155
+
156
+ ### Annotations
157
+
158
+ #### Annotation process
159
+
160
+ The dataset was labelled in two phases: the first phase included labelling 416 images and the second phase included labelling 613 images. For all the images in the dataset volunteers were provided the following table:
161
+
162
+ |Item |Description |
163
+ |------------|--------------------------------------------------------------------- |
164
+ |coveralls | Coveralls are hospital gowns worn by medical professionals as in order to provide a barrier between patient and professional, these usually cover most of the exposed skin surfaces of the professional medics.|
165
+ |mask | Mask prevents airborne transmission of infections between patients and/or treating personnel by blocking the movement of pathogens (primarily bacteria and viruses) shed in respiratory droplets and aerosols into and from the wearer’s mouth and nose.|
166
+ face shield | Face shield aims to protect the wearer’s entire face (or part of it) from hazards such as flying objects and road debris, chemical splashes (in laboratories or in industry), or potentially infectious materials (in medical and laboratory environments).|
167
+ gloves | Gloves are used during medical examinations and procedures to help prevent cross-contamination between caregivers and patients.|
168
+ |goggles | Goggles, or safety glasses, are forms of protective eye wear that usually enclose or protect the area surrounding the eye in order to prevent particulates, water or chemicals from striking the eyes.|
169
+
170
+ as well as examples of: correctly labelled images, incorrectly labelled images, and not applicable images. Before the labelling task, each volunteer was provided with an exercise to verify if the volunteer was able to correctly identify categories as well as identify if an annotated image is correctly labelled, incorrectly labelled, or not applicable. The labelling process first involved two volunteers independently labelling an image from the dataset. In any of the cases that: the number of bounding boxes are different, the labels for on or more of the bounding boxes are different or two volunteer annotations are sufficiently different; a third volunteer compiles the result from the two annotations to come up with a correctly labelled image. After this step, a volunteer verifies the bounding box annotations. Following this method of labelling the dataset we ensured that all images were labelled accurately and contained exhaustive
171
+ annotations. As a result of this, our dataset consists of 1029 high-quality, majorly non-iconic, and accurately annotated images.
172
+
173
+ #### Who are the annotators?
174
+
175
+ In both the phases crowd-sourcing techniques were used with multiple volunteers labelling the dataset using the open-source tool LabelImg.
176
+
177
+ ### Personal and Sensitive Information
178
+
179
+ [More Information Needed]
180
+
181
+ ## Considerations for Using the Data
182
+
183
+ ### Social Impact of Dataset
184
+
185
+ [More Information Needed]
186
+
187
+ ### Discussion of Biases
188
+
189
+ [More Information Needed]
190
+
191
+ ### Other Known Limitations
192
+
193
+ [More Information Needed]
194
+
195
+ ## Additional Information
196
+
197
+ ### Dataset Curators
198
+
199
+ Dagli, Rishit, and Ali Mustufa Shaikh.
200
+
201
+ ### Licensing Information
202
+
203
+ [More Information Needed]
204
+
205
+ ### Citation Information
206
+
207
+ ```
208
+ @misc{dagli2021cppe5,
209
+ title={CPPE-5: Medical Personal Protective Equipment Dataset},
210
+ author={Rishit Dagli and Ali Mustufa Shaikh},
211
+ year={2021},
212
+ eprint={2112.09569},
213
+ archivePrefix={arXiv},
214
+ primaryClass={cs.CV}
215
+ }
216
+ ```
217
+
218
+ ### Contributions
219
+
220
+ Thanks to [@mariosasko](https://github.com/mariosasko) for adding this dataset.
cppe-5.py ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """CPPE-5 dataset."""
16
+
17
+
18
+ import collections
19
+ import json
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @misc{dagli2021cppe5,
27
+ title={CPPE-5: Medical Personal Protective Equipment Dataset},
28
+ author={Rishit Dagli and Ali Mustufa Shaikh},
29
+ year={2021},
30
+ eprint={2112.09569},
31
+ archivePrefix={arXiv},
32
+ primaryClass={cs.CV}
33
+ }
34
+ """
35
+
36
+ _DESCRIPTION = """\
37
+ CPPE - 5 (Medical Personal Protective Equipment) is a new challenging dataset with the goal
38
+ to allow the study of subordinate categorization of medical personal protective equipments,
39
+ which is not possible with other popular data sets that focus on broad level categories.
40
+ """
41
+
42
+ _HOMEPAGE = "https://sites.google.com/view/cppe5"
43
+
44
+ _LICENSE = "Unknown"
45
+
46
+ _URL = "https://storage.googleapis.com/cppe-5/dataset.tar.gz"
47
+
48
+ _CATEGORIES = ["Coverall", "Face_Shield", "Gloves", "Goggles", "Mask"]
49
+
50
+
51
+ class CPPE5(datasets.GeneratorBasedBuilder):
52
+ """CPPE - 5 dataset."""
53
+
54
+ VERSION = datasets.Version("1.0.0")
55
+
56
+ def _info(self):
57
+ features = datasets.Features(
58
+ {
59
+ "image_id": datasets.Value("int64"),
60
+ "image": datasets.Image(),
61
+ "width": datasets.Value("int32"),
62
+ "height": datasets.Value("int32"),
63
+ "objects": datasets.Sequence(
64
+ {
65
+ "id": datasets.Value("int64"),
66
+ "area": datasets.Value("int64"),
67
+ "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
68
+ "category": datasets.ClassLabel(names=_CATEGORIES),
69
+ }
70
+ ),
71
+ }
72
+ )
73
+ return datasets.DatasetInfo(
74
+ description=_DESCRIPTION,
75
+ features=features,
76
+ homepage=_HOMEPAGE,
77
+ license=_LICENSE,
78
+ citation=_CITATION,
79
+ )
80
+
81
+ def _split_generators(self, dl_manager):
82
+ archive = dl_manager.download(_URL)
83
+ return [
84
+ datasets.SplitGenerator(
85
+ name=datasets.Split.TRAIN,
86
+ gen_kwargs={
87
+ "annotation_file_path": "annotations/train.json",
88
+ "files": dl_manager.iter_archive(archive),
89
+ },
90
+ ),
91
+ datasets.SplitGenerator(
92
+ name=datasets.Split.TEST,
93
+ gen_kwargs={
94
+ "annotation_file_path": "annotations/test.json",
95
+ "files": dl_manager.iter_archive(archive),
96
+ },
97
+ ),
98
+ ]
99
+
100
+ def _generate_examples(self, annotation_file_path, files):
101
+ def process_annot(annot, category_id_to_category):
102
+ return {
103
+ "id": annot["id"],
104
+ "area": annot["area"],
105
+ "bbox": annot["bbox"],
106
+ "category": category_id_to_category[annot["category_id"]],
107
+ }
108
+
109
+ image_id_to_image = {}
110
+ idx = 0
111
+ # This loop relies on the ordering of the files in the archive:
112
+ # Annotation files come first, then the images.
113
+ for path, f in files:
114
+ file_name = os.path.basename(path)
115
+ if path == annotation_file_path:
116
+ annotations = json.load(f)
117
+ category_id_to_category = {category["id"]: category["name"] for category in annotations["categories"]}
118
+ image_id_to_annotations = collections.defaultdict(list)
119
+ for annot in annotations["annotations"]:
120
+ image_id_to_annotations[annot["image_id"]].append(annot)
121
+ image_id_to_image = {annot["file_name"]: annot for annot in annotations["images"]}
122
+ elif file_name in image_id_to_image:
123
+ image = image_id_to_image[file_name]
124
+ objects = [
125
+ process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
126
+ ]
127
+ yield idx, {
128
+ "image_id": image["id"],
129
+ "image": {"path": path, "bytes": f.read()},
130
+ "width": image["width"],
131
+ "height": image["height"],
132
+ "objects": objects,
133
+ }
134
+ idx += 1
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "CPPE - 5 (Medical Personal Protective Equipment) is a new challenging dataset with the goal\nto allow the study of subordinate categorization of medical personal protective equipments,\nwhich is not possible with other popular data sets that focus on broad level categories.\n", "citation": "@misc{dagli2021cppe5,\n title={CPPE-5: Medical Personal Protective Equipment Dataset},\n author={Rishit Dagli and Ali Mustufa Shaikh},\n year={2021},\n eprint={2112.09569},\n archivePrefix={arXiv},\n primaryClass={cs.CV}\n}\n", "homepage": "https://sites.google.com/view/cppe5", "license": "Unknown", "features": {"image_id": {"dtype": "int64", "id": null, "_type": "Value"}, "image": {"id": null, "_type": "Image"}, "width": {"dtype": "int32", "id": null, "_type": "Value"}, "height": {"dtype": "int32", "id": null, "_type": "Value"}, "objects": {"feature": {"id": {"dtype": "int64", "id": null, "_type": "Value"}, "area": {"dtype": "int64", "id": null, "_type": "Value"}, "bbox": {"feature": {"dtype": "float32", "id": null, "_type": "Value"}, "length": 4, "id": null, "_type": "Sequence"}, "category": {"num_classes": 5, "names": ["Coverall", "Face_Shield", "Gloves", "Goggles", "Mask"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cppe5", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 240481281, "num_examples": 1000, "dataset_name": "cppe5"}, "test": {"name": "test", "num_bytes": 4172739, "num_examples": 29, "dataset_name": "cppe5"}}, "download_checksums": {"https://storage.googleapis.com/cppe-5/dataset.tar.gz": {"num_bytes": 238482705, "checksum": "1151086e59fcb87825ecf4d362847a3f023ba69e7ace0f513d5aadc0e3dd3094"}}, "download_size": 238482705, "post_processing_size": null, "dataset_size": 244654020, "size_in_bytes": 483136725}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa8ea6a457b7625ff379b8b1fc88b8342baf59b2f7c2227957bb6bab915708b4
3
+ size 4005