PHilita commited on
Commit
413e6e6
1 Parent(s): 75ceffd

dataset info and dataset.py cleanup. Changed download url

Browse files
Carla-COCO-Object-Detection-Dataset.py CHANGED
@@ -1,18 +1,23 @@
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
@@ -22,39 +27,32 @@ import os
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://drive.google.com/uc?id=1MGnaAfbckUmigGUvihz7uiHGC6rBIbvr"
47
- _URL = "https://huggingface.co/datasets/yunusskeete/cppe5/resolve/main/cppe5.tar.gz"
48
 
49
  _CATEGORIES = ["automobile", "bike", "motorbike", "traffic_light", "traffic_sign"]
50
 
51
 
52
- class CPPE5(datasets.GeneratorBasedBuilder):
53
- """CPPE - 5 dataset."""
54
 
55
- VERSION = datasets.Version("1.0.0")
56
 
57
  def _info(self):
 
 
58
  features = datasets.Features(
59
  {
60
  "image_id": datasets.Value("int64"),
@@ -76,10 +74,11 @@ class CPPE5(datasets.GeneratorBasedBuilder):
76
  features=features,
77
  homepage=_HOMEPAGE,
78
  license=_LICENSE,
79
- citation=_CITATION,
80
  )
81
 
82
  def _split_generators(self, dl_manager):
 
 
83
  archive = dl_manager.download(_URL)
84
  return [
85
  datasets.SplitGenerator(
@@ -98,7 +97,13 @@ class CPPE5(datasets.GeneratorBasedBuilder):
98
  ),
99
  ]
100
 
 
101
  def _generate_examples(self, annotation_file_path, files):
 
 
 
 
 
102
  def process_annot(annot, category_id_to_category):
103
  return {
104
  "id": annot["id"],
@@ -134,54 +139,7 @@ class CPPE5(datasets.GeneratorBasedBuilder):
134
  }
135
  idx += 1
136
 
137
- # # coding=utf-8
138
- # # Permission is hereby granted, free of charge, to any person obtaining
139
- # # a copy of this software and associated documentation files (the
140
- # # "Software"), to deal in the Software without restriction, including
141
- # # without limitation the rights to use, copy, modify, merge, publish,
142
- # # distribute, sublicense, and/or sell copies of the Software, and to
143
- # # permit persons to whom the Software is furnished to do so, subject to
144
- # # the following conditions:
145
-
146
- # # The above copyright notice and this permission notice shall be
147
- # # included in all copies or substantial portions of the Software.
148
-
149
- # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
150
- # # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
151
- # # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
152
- # # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
153
- # # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
154
- # # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
155
- # # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
156
- # """Carla-COCO-Object-Detection-Dataset"""
157
-
158
- # import collections
159
- # import json
160
- # import os
161
-
162
- # import datasets
163
-
164
-
165
- # logger = datasets.logging.get_logger(__name__)
166
-
167
- # _DESCRIPTION = """\
168
- # This dataset contains 1028 images each 640x380 pixels.
169
- # The dataset is split into 249 test and 779 training examples.
170
- # Every image comes with MS COCO format annotations.
171
- # The dataset was collected in Carla Simulator, driving around in autopilot mode in various environments
172
- # (Town01, Town02, Town03, Town04, Town05) and saving every i-th frame.
173
- # The labels where then automatically generated using the semantic segmentation information.
174
- # """
175
-
176
- # _HOMEPAGE = "https://github.com/yunusskeete/Carla-COCO-Object-Detection-Dataset"
177
-
178
- # _LICENSE = "MIT"
179
-
180
- # # _URL = "https://drive.google.com/uc?id=1QeveFt1jDNrafJeeCV1N_KoIKQEZyhuf"
181
- # # # _URL = "https://drive.google.com/uc?id=1xUPwrMBBrGFIapLx_fyLjmH4HN16A4iZ"
182
- # _URL = "https://huggingface.co/datasets/yunusskeete/Carla-COCO-Object-Detection-Dataset/resolve/main/Carla-COCO-Object-Detection-Dataset.tar.gz"
183
 
184
- # _CATEGORIES = ["automobile", "bike", "motorbike", "traffic_light", "traffic_sign"]
185
 
186
  # class CARLA_COCO(datasets.GeneratorBasedBuilder):
187
  # """Carla-COCO-Object-Detection-Dataset"""
 
1
  # coding=utf-8
2
+ # Permission is hereby granted, free of charge, to any person obtaining
3
+ # a copy of this software and associated documentation files (the
4
+ # "Software"), to deal in the Software without restriction, including
5
+ # without limitation the rights to use, copy, modify, merge, publish,
6
+ # distribute, sublicense, and/or sell copies of the Software, and to
7
+ # permit persons to whom the Software is furnished to do so, subject to
8
+ # the following conditions:
9
+
10
+ # The above copyright notice and this permission notice shall be
11
+ # included in all copies or substantial portions of the Software.
12
+
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ """Carla-COCO-Object-Detection-Dataset"""
21
 
22
 
23
  import collections
 
27
  import datasets
28
 
29
 
 
 
 
 
 
 
 
 
 
 
 
30
  _DESCRIPTION = """\
31
+ This dataset contains 1028 images each 640x380 pixels.
32
+ The dataset is split into 249 test and 779 training examples.
33
+ Every image comes with MS COCO format annotations.
34
+ The dataset was collected in Carla Simulator, driving around in autopilot mode in various environments
35
+ (Town01, Town02, Town03, Town04, Town05) and saving every i-th frame.
36
+ The labels where then automatically generated using the semantic segmentation information.
37
  """
38
 
39
+ _HOMEPAGE = "https://github.com/yunusskeete/Carla-COCO-Object-Detection-Dataset"
40
 
41
+ _LICENSE = "MIT"
42
 
43
+ _URL = "https://huggingface.co/datasets/yunusskeete/Carla-COCO-Object-Detection-Dataset/resolve/main/Carla-COCO-Object-Detection-Dataset.tar.gz"
 
44
 
45
  _CATEGORIES = ["automobile", "bike", "motorbike", "traffic_light", "traffic_sign"]
46
 
47
 
48
+ class CARLA_COCO(datasets.GeneratorBasedBuilder):
49
+ """Carla-COCO-Object-Detection-Dataset"""
50
 
51
+ VERSION = datasets.Version("1.1.0")
52
 
53
  def _info(self):
54
+ """This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset"""
55
+
56
  features = datasets.Features(
57
  {
58
  "image_id": datasets.Value("int64"),
 
74
  features=features,
75
  homepage=_HOMEPAGE,
76
  license=_LICENSE,
 
77
  )
78
 
79
  def _split_generators(self, dl_manager):
80
+ """This method is tasked with downloading/extracting the data and defining the splits depending on the configuration"""
81
+
82
  archive = dl_manager.download(_URL)
83
  return [
84
  datasets.SplitGenerator(
 
97
  ),
98
  ]
99
 
100
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
101
  def _generate_examples(self, annotation_file_path, files):
102
+ """
103
+ This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
104
+ The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
105
+ """
106
+
107
  def process_annot(annot, category_id_to_category):
108
  return {
109
  "id": annot["id"],
 
139
  }
140
  idx += 1
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
 
143
 
144
  # class CARLA_COCO(datasets.GeneratorBasedBuilder):
145
  # """Carla-COCO-Object-Detection-Dataset"""
Carla-COCO-Object-Detection-Dataset.tar.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c5f5f1aef3d9c7b42b2c81c731bb4730e04155632efa4e9963d9d90adc3e06bc
3
  size 396705079
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98b2b74c03d1229531cd588b2da3d210dd6bee995a255a7c5740eba4d18bbc33
3
  size 396705079
dataset_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"description": "Hugging Face COCO-Style Labelled Dataset for Object Detection in Carla Simulator: This dataset contains 1028 images, each 640x380 pixels, with corresponding publically accessible URLs. The dataset is split into 249 test and 779 training examples. The dataset was collected in Carla Simulator, driving around in autopilot mode in various environments (Town01, Town02, Town03, Town04, Town05) and saving every i-th frame. The labels where then automatically generated using the semantic segmentation information.", "citation": "", "homepage": "https://github.com/yunusskeete/Carla-COCO-Object-Detection-Dataset", "license": "MIT", "features": {"image_id": {"dtype": "int64", "_type": "Value"}, "image": {"_type": "Image"}, "width": {"dtype": "int32", "_type": "Value"}, "height": {"dtype": "int32", "_type": "Value"}, "objects": {"feature": {"id": {"dtype": "int64", "_type": "Value"}, "area": {"dtype": "int64", "_type": "Value"}, "bbox": {"feature": {"dtype": "float32", "_type": "Value"}, "length": 4, "_type": "Sequence"}, "category": {"names": ["automobile", "bike", "motorbike", "traffic_light", "traffic_sign"], "_type": "ClassLabel"}}, "_type": "Sequence"}}, "builder_name": "Carla-COCO-Object-Detection-Dataset", "dataset_name": "Carla-COCO-Object-Detection-Dataset", "config_name": "default", "version": {"version_str": "1.1.0", "major": 1, "minor": 1, "patch": 0}, "download_checksums": {"https://huggingface.co/datasets/yunusskeete/cppe5/resolve/main/cppe5.tar.gz": {"num_bytes": 396704813, "checksum": "c5f5f1aef3d9c7b42b2c81c731bb4730e04155632efa4e9963d9d90adc3e06bc"}}, "download_size": 396704813, "dataset_size": 396736033, "size_in_bytes": 793440846}
dataset_infos.json DELETED
@@ -1 +0,0 @@
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": ["automobile", "bike", "motorbike", "traffic_light", "traffic_sign"], "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": 779, "dataset_name": "cppe5"}, "test": {"name": "test", "num_bytes": 4172739, "num_examples": 249, "dataset_name": "cppe5"}}, "download_checksums": {"https://drive.google.com/uc?id=1MGnaAfbckUmigGUvihz7uiHGC6rBIbvr": {"num_bytes": 238482705, "checksum": "1151086e59fcb87825ecf4d362847a3f023ba69e7ace0f513d5aadc0e3dd3094"}}, "download_size": 238482705, "post_processing_size": null, "dataset_size": 244654020, "size_in_bytes": 483136725}}