PierreLeveau commited on
Commit
26e6b2d
1 Parent(s): af27ffa

dataset: versioning and info

Browse files
Files changed (2) hide show
  1. dataset_infos.json +98 -1
  2. plastic_in_river.py +4 -5
dataset_infos.json CHANGED
@@ -1 +1,98 @@
1
- {"default": {"description": "\n This dataset contains photos of rivers on which there may be waste. The waste items are annotated \n through bounding boxes, and are assigned to one of the 4 following categories: plastic bottle, plastic bag, \n another plastic waste, or non-plastic waste. Note that some photos may not contain any waste.\n", "citation": "", "homepage": "", "license": "", "features": {"image": {"decode": true, "id": null, "_type": "Image"}, "litter": {"feature": {"label": {"num_classes": 3, "names": ["PLASTIC_BAG", "PLASTIC_BOTTLE", "OTHER_PLASTIC_WASTE"], "names_file": null, "id": null, "_type": "ClassLabel"}, "bbox": {"feature": {"dtype": "float32", "id": null, "_type": "Value"}, "length": 4, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "litter_challenge_test", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 59176802, "num_examples": 50, "dataset_name": "litter_challenge_test"}, "test": {"name": "test", "num_bytes": 8336276, "num_examples": 7, "dataset_name": "litter_challenge_test"}, "validation": {"name": "validation", "num_bytes": 5948908, "num_examples": 6, "dataset_name": "litter_challenge_test"}}, "download_checksums": {"https://storage.googleapis.com/kili-datasets-public/plastic-in-river/train/images.tar.gz": {"num_bytes": 15297527, "checksum": "8667f292b829a9979d0bef6e9acc9f8981c2a2f8e669c7014f739f107329e4ad"}, "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/train/annotations.tar.gz": {"num_bytes": 4177, "checksum": "dd3856450d6d573a52e25215cc642bc5bca3804985c055661ff6cef7c581789f"}, "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/validation/images.tar.gz": {"num_bytes": 1461341, "checksum": "6074f2406d09897787e3c8e4814f63349fe9c709f63620bd3bab0619884af03a"}, "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/validation/annotations.tar.gz": {"num_bytes": 501, "checksum": "29c985cdf46e6c592a3899185e956ca11eee64c61660e09f9cdb2ed2148b68ea"}, "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/test/images.tar.gz": {"num_bytes": 2153491, "checksum": "6a69678d3723dbe8fea227526229e43969e55b3134a5927c8bf0279cc26c0edb"}, "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/test/annotations.tar.gz": {"num_bytes": 853, "checksum": "83a90a11bcc598080e54c0a300ec5c0eae970c78bc1638d2de822e0bb61c7884"}}, "download_size": 18917890, "post_processing_size": null, "dataset_size": 73461986, "size_in_bytes": 92379876}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "default": {
3
+ "description": "\n This dataset contains photos of rivers on which there may be waste. The waste items are annotated\n through bounding boxes, and are assigned to one of the 4 following categories: plastic bottle, plastic bag,\n another plastic waste, or non-plastic waste. Note that some photos may not contain any waste.\n",
4
+ "citation": "",
5
+ "homepage": "",
6
+ "license": "",
7
+ "features": {
8
+ "image": { "decode": true, "id": null, "_type": "Image" },
9
+ "litter": {
10
+ "feature": {
11
+ "label": {
12
+ "num_classes": 4,
13
+ "names": [
14
+ "PLASTIC_BAG",
15
+ "PLASTIC_BOTTLE",
16
+ "OTHER_PLASTIC_WASTE",
17
+ "NOT_PLASTIC_WASTE"
18
+ ],
19
+ "names_file": null,
20
+ "id": null,
21
+ "_type": "ClassLabel"
22
+ },
23
+ "bbox": {
24
+ "feature": { "dtype": "float32", "id": null, "_type": "Value" },
25
+ "length": 4,
26
+ "id": null,
27
+ "_type": "Sequence"
28
+ }
29
+ },
30
+ "length": -1,
31
+ "id": null,
32
+ "_type": "Sequence"
33
+ }
34
+ },
35
+ "post_processed": null,
36
+ "supervised_keys": null,
37
+ "task_templates": null,
38
+ "builder_name": "plastic_in_river",
39
+ "config_name": "default",
40
+ "version": {
41
+ "version_str": "1.0.0",
42
+ "description": null,
43
+ "major": 1,
44
+ "minor": 0,
45
+ "patch": 0
46
+ },
47
+ "splits": {
48
+ "train": {
49
+ "name": "train",
50
+ "num_bytes": 1382005709,
51
+ "num_examples": 1186,
52
+ "dataset_name": "plastic_in_river"
53
+ },
54
+ "test": {
55
+ "name": "test",
56
+ "num_bytes": 174268213,
57
+ "num_examples": 149,
58
+ "dataset_name": "plastic_in_river"
59
+ },
60
+ "validation": {
61
+ "name": "validation",
62
+ "num_bytes": 170939935,
63
+ "num_examples": 148,
64
+ "dataset_name": "plastic_in_river"
65
+ }
66
+ },
67
+ "download_checksums": {
68
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/train/images.tar.gz": {
69
+ "num_bytes": 350379542,
70
+ "checksum": "38fcc632c2c158dc746933e385aecca9f60dac9288da6676f6594b3b585fc025"
71
+ },
72
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/train/annotations.tar.gz": {
73
+ "num_bytes": 180827,
74
+ "checksum": "70015049c893a3bb2e1bd0ff6a5926250908221f236dc2b75d54833e84aee4e0"
75
+ },
76
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/validation/images.tar.gz": {
77
+ "num_bytes": 43885822,
78
+ "checksum": "fd297e2c42a6b8480b9445522b69fb6daaffaf169d5e6735e1925a12ba4c07d6"
79
+ },
80
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/validation/annotations.tar.gz": {
81
+ "num_bytes": 15474,
82
+ "checksum": "6ff36a120ac0759426800557de7751317ce6f2c2b02857f0c53527f640747bf5"
83
+ },
84
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/test/images.tar.gz": {
85
+ "num_bytes": 44563692,
86
+ "checksum": "b869224b3204f4d2cab176a32f903b9afdb77005f9d15e1844c6bf8484b4bf8f"
87
+ },
88
+ "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/v1.0.0/test/annotations.tar.gz": {
89
+ "num_bytes": 15155,
90
+ "checksum": "e30057eac9f05c4759baab31830f1752fe42ef51680523d17df02a44183ed274"
91
+ }
92
+ },
93
+ "download_size": 439040512,
94
+ "post_processing_size": null,
95
+ "dataset_size": 1727213857,
96
+ "size_in_bytes": 2166254369
97
+ }
98
+ }
plastic_in_river.py CHANGED
@@ -16,10 +16,7 @@ _HOMEPAGE = ""
16
 
17
  _LICENSE = ""
18
 
19
- # # TODO: Add link to the official dataset URLs here
20
- # # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
21
- # # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
22
- _URL = "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/"
23
 
24
  _URLS = {
25
  "train_images": f"{_URL}train/images.tar.gz",
@@ -55,7 +52,9 @@ class PlasticInRiver(datasets.GeneratorBasedBuilder):
55
  )
56
 
57
  def _split_generators(self, dl_manager):
58
- downloaded_files = dl_manager.download(_URLS)
 
 
59
 
60
  return [
61
  datasets.SplitGenerator(
16
 
17
  _LICENSE = ""
18
 
19
+ _URL = "https://storage.googleapis.com/kili-datasets-public/plastic-in-river/<VERSION>/"
 
 
 
20
 
21
  _URLS = {
22
  "train_images": f"{_URL}train/images.tar.gz",
52
  )
53
 
54
  def _split_generators(self, dl_manager):
55
+ urls = {k: v.replace("<VERSION>", f"v{str(self.VERSION)}") for k, v in _URLS.items()}
56
+
57
+ downloaded_files = dl_manager.download(urls)
58
 
59
  return [
60
  datasets.SplitGenerator(