albertvillanova HF staff commited on
Commit
e06acf2
1 Parent(s): 6981991

Convert dataset to Parquet (#3)

Browse files

- Convert dataset to Parquet (1ac27ab4707a642b84c229d077056d0f25a62fa7)
- Delete loading script (d420fa681efa870059c1d8047aab8732530372e3)
- Delete legacy dataset_infos.json (a050edba943ae2b0fa8700e89702531b3dd9a9ea)

README.md CHANGED
@@ -130,13 +130,20 @@ dataset_info:
130
  '100': waffles
131
  splits:
132
  - name: train
133
- num_bytes: 3845865322
134
  num_examples: 75750
135
  - name: validation
136
- num_bytes: 1276249954
137
  num_examples: 25250
138
- download_size: 4998236572
139
- dataset_size: 5122115276
 
 
 
 
 
 
 
140
  ---
141
 
142
  # Dataset Card for Food-101
 
130
  '100': waffles
131
  splits:
132
  - name: train
133
+ num_bytes: 3842657187.0
134
  num_examples: 75750
135
  - name: validation
136
+ num_bytes: 1275182340.5
137
  num_examples: 25250
138
+ download_size: 5059972308
139
+ dataset_size: 5117839527.5
140
+ configs:
141
+ - config_name: default
142
+ data_files:
143
+ - split: train
144
+ path: data/train-*
145
+ - split: validation
146
+ path: data/validation-*
147
  ---
148
 
149
  # Dataset Card for Food-101
data/train-00000-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:015e9a99c7d302efbd261b8015a27f61083d8efa6dcb495bffd296778ffd9d36
3
+ size 489582959
data/train-00001-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22519893e937136db7a791e2815a63a4dbbdd8ba75bb4b8b37df83871ca3d2b1
3
+ size 464225341
data/train-00002-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:119cdf8ad024e8563f2bf60393b167aa9a18d1bbf4f9dc7227473a94db168d7a
3
+ size 472211726
data/train-00003-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8fa54bb56be8b9b75aec29046d952947587f266b5ec54633a6e44c35c34fde22
3
+ size 463644865
data/train-00004-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f127dcc262bce811e8b690b5834fc7cb13f82461a1fe1650711623e86aa4a19
3
+ size 475091267
data/train-00005-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c02192cb6183ae554a97ecf7b3e7e25240c3a32e99a630343c430eabd859fcc
3
+ size 469875468
data/train-00006-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e45129fa1cb069859df21467b68bab7e57fcb0d93c9cf36c7e4bc56d3cdddc0b
3
+ size 478240948
data/train-00007-of-00008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44affd2f82062a2824093fb5675f0d753ebc5c72a983b6b4876837f3799441e5
3
+ size 485648421
data/validation-00000-of-00003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2815a26a09dc7cb1e587a83065ecb5691a76ae72796f9f49b6e9bd1b471b5f11
3
+ size 422634283
data/validation-00001-of-00003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ca90c6195f711b8884eff2c3035e18e7a18ba1fbb01f8ebdd8b0ee31c64bd8b
3
+ size 413147844
data/validation-00002-of-00003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb53efb57324418771304663cff8b7bbdf149dfd69996a7d15b3a94a04e62999
3
+ size 425669186
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"default": {"description": "This dataset consists of 101 food categories, with 101'000 images. For each class, 250 manually reviewed test images are provided as well as 750 training images. On purpose, the training images were not cleaned, and thus still contain some amount of noise. This comes mostly in the form of intense colors and sometimes wrong labels. All images were rescaled to have a maximum side length of 512 pixels.", "citation": " @inproceedings{bossard14,\n title = {Food-101 -- Mining Discriminative Components with Random Forests},\n author = {Bossard, Lukas and Guillaumin, Matthieu and Van Gool, Luc},\n booktitle = {European Conference on Computer Vision},\n year = {2014}\n}\n", "homepage": "https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/", "license": "LICENSE AGREEMENT\n=================\n - The Food-101 data set consists of images from Foodspotting [1] which are not\n property of the Federal Institute of Technology Zurich (ETHZ). Any use beyond\n scientific fair use must be negociated with the respective picture owners\n according to the Foodspotting terms of use [2].\n\n[1] http://www.foodspotting.com/\n[2] http://www.foodspotting.com/terms/\n", "features": {"image": {"id": null, "_type": "Image"}, "label": {"num_classes": 101, "names": ["apple_pie", "baby_back_ribs", "baklava", "beef_carpaccio", "beef_tartare", "beet_salad", "beignets", "bibimbap", "bread_pudding", "breakfast_burrito", "bruschetta", "caesar_salad", "cannoli", "caprese_salad", "carrot_cake", "ceviche", "cheesecake", "cheese_plate", "chicken_curry", "chicken_quesadilla", "chicken_wings", "chocolate_cake", "chocolate_mousse", "churros", "clam_chowder", "club_sandwich", "crab_cakes", "creme_brulee", "croque_madame", "cup_cakes", "deviled_eggs", "donuts", "dumplings", "edamame", "eggs_benedict", "escargots", "falafel", "filet_mignon", "fish_and_chips", "foie_gras", "french_fries", "french_onion_soup", "french_toast", "fried_calamari", "fried_rice", "frozen_yogurt", "garlic_bread", "gnocchi", "greek_salad", "grilled_cheese_sandwich", "grilled_salmon", "guacamole", "gyoza", "hamburger", "hot_and_sour_soup", "hot_dog", "huevos_rancheros", "hummus", "ice_cream", "lasagna", "lobster_bisque", "lobster_roll_sandwich", "macaroni_and_cheese", "macarons", "miso_soup", "mussels", "nachos", "omelette", "onion_rings", "oysters", "pad_thai", "paella", "pancakes", "panna_cotta", "peking_duck", "pho", "pizza", "pork_chop", "poutine", "prime_rib", "pulled_pork_sandwich", "ramen", "ravioli", "red_velvet_cake", "risotto", "samosa", "sashimi", "scallops", "seaweed_salad", "shrimp_and_grits", "spaghetti_bolognese", "spaghetti_carbonara", "spring_rolls", "steak", "strawberry_shortcake", "sushi", "tacos", "takoyaki", "tiramisu", "tuna_tartare", "waffles"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "image", "output": "label"}, "task_templates": [{"task": "image-classification", "image_column": "image", "label_column": "label", "labels": ["apple_pie", "baby_back_ribs", "baklava", "beef_carpaccio", "beef_tartare", "beet_salad", "beignets", "bibimbap", "bread_pudding", "breakfast_burrito", "bruschetta", "caesar_salad", "cannoli", "caprese_salad", "carrot_cake", "ceviche", "cheese_plate", "cheesecake", "chicken_curry", "chicken_quesadilla", "chicken_wings", "chocolate_cake", "chocolate_mousse", "churros", "clam_chowder", "club_sandwich", "crab_cakes", "creme_brulee", "croque_madame", "cup_cakes", "deviled_eggs", "donuts", "dumplings", "edamame", "eggs_benedict", "escargots", "falafel", "filet_mignon", "fish_and_chips", "foie_gras", "french_fries", "french_onion_soup", "french_toast", "fried_calamari", "fried_rice", "frozen_yogurt", "garlic_bread", "gnocchi", "greek_salad", "grilled_cheese_sandwich", "grilled_salmon", "guacamole", "gyoza", "hamburger", "hot_and_sour_soup", "hot_dog", "huevos_rancheros", "hummus", "ice_cream", "lasagna", "lobster_bisque", "lobster_roll_sandwich", "macaroni_and_cheese", "macarons", "miso_soup", "mussels", "nachos", "omelette", "onion_rings", "oysters", "pad_thai", "paella", "pancakes", "panna_cotta", "peking_duck", "pho", "pizza", "pork_chop", "poutine", "prime_rib", "pulled_pork_sandwich", "ramen", "ravioli", "red_velvet_cake", "risotto", "samosa", "sashimi", "scallops", "seaweed_salad", "shrimp_and_grits", "spaghetti_bolognese", "spaghetti_carbonara", "spring_rolls", "steak", "strawberry_shortcake", "sushi", "tacos", "takoyaki", "tiramisu", "tuna_tartare", "waffles"]}], "builder_name": "food101", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3845865322, "num_examples": 75750, "dataset_name": "food101"}, "validation": {"name": "validation", "num_bytes": 1276249954, "num_examples": 25250, "dataset_name": "food101"}}, "download_checksums": {"http://data.vision.ee.ethz.ch/cvl/food-101.tar.gz": {"num_bytes": 4996278331, "checksum": "d97d15e438b7f4498f96086a4f7e2fa42a32f2712e87d3295441b2b6314053a4"}, "https://s3.amazonaws.com/datasets.huggingface.co/food101/meta/train.txt": {"num_bytes": 1468812, "checksum": "2920f7d55473974492b41a01241ccfd71df1b74d29d27b617337f840f58f77ab"}, "https://s3.amazonaws.com/datasets.huggingface.co/food101/meta/test.txt": {"num_bytes": 489429, "checksum": "440d53374697d019a972fe66e8e44031ae80267a126ecb814ad537ec1fd506db"}}, "download_size": 4998236572, "post_processing_size": null, "dataset_size": 5122115276, "size_in_bytes": 10120351848}}
 
 
food101.py DELETED
@@ -1,217 +0,0 @@
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
- """Dataset class for Food-101 dataset."""
16
-
17
- import datasets
18
- from datasets.tasks import ImageClassification
19
-
20
-
21
- _BASE_URL = "http://data.vision.ee.ethz.ch/cvl/food-101.tar.gz"
22
-
23
- _METADATA_URLS = {
24
- "train": "https://s3.amazonaws.com/datasets.huggingface.co/food101/meta/train.txt",
25
- "test": "https://s3.amazonaws.com/datasets.huggingface.co/food101/meta/test.txt",
26
- }
27
-
28
- _HOMEPAGE = "https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/"
29
-
30
- _DESCRIPTION = (
31
- "This dataset consists of 101 food categories, with 101'000 images. For "
32
- "each class, 250 manually reviewed test images are provided as well as 750"
33
- " training images. On purpose, the training images were not cleaned, and "
34
- "thus still contain some amount of noise. This comes mostly in the form of"
35
- " intense colors and sometimes wrong labels. All images were rescaled to "
36
- "have a maximum side length of 512 pixels."
37
- )
38
-
39
- _CITATION = """\
40
- @inproceedings{bossard14,
41
- title = {Food-101 -- Mining Discriminative Components with Random Forests},
42
- author = {Bossard, Lukas and Guillaumin, Matthieu and Van Gool, Luc},
43
- booktitle = {European Conference on Computer Vision},
44
- year = {2014}
45
- }
46
- """
47
-
48
- _LICENSE = """\
49
- LICENSE AGREEMENT
50
- =================
51
- - The Food-101 data set consists of images from Foodspotting [1] which are not
52
- property of the Federal Institute of Technology Zurich (ETHZ). Any use beyond
53
- scientific fair use must be negociated with the respective picture owners
54
- according to the Foodspotting terms of use [2].
55
-
56
- [1] http://www.foodspotting.com/
57
- [2] http://www.foodspotting.com/terms/
58
- """
59
-
60
- _NAMES = [
61
- "apple_pie",
62
- "baby_back_ribs",
63
- "baklava",
64
- "beef_carpaccio",
65
- "beef_tartare",
66
- "beet_salad",
67
- "beignets",
68
- "bibimbap",
69
- "bread_pudding",
70
- "breakfast_burrito",
71
- "bruschetta",
72
- "caesar_salad",
73
- "cannoli",
74
- "caprese_salad",
75
- "carrot_cake",
76
- "ceviche",
77
- "cheesecake",
78
- "cheese_plate",
79
- "chicken_curry",
80
- "chicken_quesadilla",
81
- "chicken_wings",
82
- "chocolate_cake",
83
- "chocolate_mousse",
84
- "churros",
85
- "clam_chowder",
86
- "club_sandwich",
87
- "crab_cakes",
88
- "creme_brulee",
89
- "croque_madame",
90
- "cup_cakes",
91
- "deviled_eggs",
92
- "donuts",
93
- "dumplings",
94
- "edamame",
95
- "eggs_benedict",
96
- "escargots",
97
- "falafel",
98
- "filet_mignon",
99
- "fish_and_chips",
100
- "foie_gras",
101
- "french_fries",
102
- "french_onion_soup",
103
- "french_toast",
104
- "fried_calamari",
105
- "fried_rice",
106
- "frozen_yogurt",
107
- "garlic_bread",
108
- "gnocchi",
109
- "greek_salad",
110
- "grilled_cheese_sandwich",
111
- "grilled_salmon",
112
- "guacamole",
113
- "gyoza",
114
- "hamburger",
115
- "hot_and_sour_soup",
116
- "hot_dog",
117
- "huevos_rancheros",
118
- "hummus",
119
- "ice_cream",
120
- "lasagna",
121
- "lobster_bisque",
122
- "lobster_roll_sandwich",
123
- "macaroni_and_cheese",
124
- "macarons",
125
- "miso_soup",
126
- "mussels",
127
- "nachos",
128
- "omelette",
129
- "onion_rings",
130
- "oysters",
131
- "pad_thai",
132
- "paella",
133
- "pancakes",
134
- "panna_cotta",
135
- "peking_duck",
136
- "pho",
137
- "pizza",
138
- "pork_chop",
139
- "poutine",
140
- "prime_rib",
141
- "pulled_pork_sandwich",
142
- "ramen",
143
- "ravioli",
144
- "red_velvet_cake",
145
- "risotto",
146
- "samosa",
147
- "sashimi",
148
- "scallops",
149
- "seaweed_salad",
150
- "shrimp_and_grits",
151
- "spaghetti_bolognese",
152
- "spaghetti_carbonara",
153
- "spring_rolls",
154
- "steak",
155
- "strawberry_shortcake",
156
- "sushi",
157
- "tacos",
158
- "takoyaki",
159
- "tiramisu",
160
- "tuna_tartare",
161
- "waffles",
162
- ]
163
-
164
- _IMAGES_DIR = "food-101/images/"
165
-
166
-
167
- class Food101(datasets.GeneratorBasedBuilder):
168
- """Food-101 Images dataset."""
169
-
170
- def _info(self):
171
- return datasets.DatasetInfo(
172
- description=_DESCRIPTION,
173
- features=datasets.Features(
174
- {
175
- "image": datasets.Image(),
176
- "label": datasets.ClassLabel(names=_NAMES),
177
- }
178
- ),
179
- supervised_keys=("image", "label"),
180
- homepage=_HOMEPAGE,
181
- citation=_CITATION,
182
- license=_LICENSE,
183
- task_templates=[ImageClassification(image_column="image", label_column="label")],
184
- )
185
-
186
- def _split_generators(self, dl_manager):
187
- archive_path = dl_manager.download(_BASE_URL)
188
- split_metadata_paths = dl_manager.download(_METADATA_URLS)
189
- return [
190
- datasets.SplitGenerator(
191
- name=datasets.Split.TRAIN,
192
- gen_kwargs={
193
- "images": dl_manager.iter_archive(archive_path),
194
- "metadata_path": split_metadata_paths["train"],
195
- },
196
- ),
197
- datasets.SplitGenerator(
198
- name=datasets.Split.VALIDATION,
199
- gen_kwargs={
200
- "images": dl_manager.iter_archive(archive_path),
201
- "metadata_path": split_metadata_paths["test"],
202
- },
203
- ),
204
- ]
205
-
206
- def _generate_examples(self, images, metadata_path):
207
- """Generate images and labels for splits."""
208
- with open(metadata_path, encoding="utf-8") as f:
209
- files_to_keep = set(f.read().split("\n"))
210
- for file_path, file_obj in images:
211
- if file_path.startswith(_IMAGES_DIR):
212
- if file_path[len(_IMAGES_DIR) : -len(".jpg")] in files_to_keep:
213
- label = file_path.split("/")[2]
214
- yield file_path, {
215
- "image": {"path": file_path, "bytes": file_obj.read()},
216
- "label": label,
217
- }