Skip to content

Commit

Permalink
update dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoestq committed Oct 12, 2021
1 parent 500d1ce commit 2c1b6fd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion datasets/food101/dataset_infos.json
Original file line number Diff line number Diff line change
@@ -1 +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": {"dtype": "binary", "id": null, "_type": "Value"}, "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_file_path_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": 3842654228, "num_examples": 75750, "dataset_name": "food101"}, "validation": {"name": "validation", "num_bytes": 1275179763, "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": 5117833991, "size_in_bytes": 10116070563}}
{"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": {"dtype": "binary", "id": null, "_type": "Value"}, "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": null, "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": 3842654228, "num_examples": 75750, "dataset_name": "food101"}, "validation": {"name": "validation", "num_bytes": 1275179763, "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": 5117833991, "size_in_bytes": 10116070563}}
Binary file modified datasets/food101/dummy/0.0.0/dummy_data.zip
Binary file not shown.
4 changes: 0 additions & 4 deletions datasets/food101/food101.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
# limitations under the License.
"""Dataset class for Food-101 dataset."""

import json
from pathlib import Path

import datasets
from datasets.tasks import ImageClassification

Expand Down Expand Up @@ -181,7 +178,6 @@ def _info(self):
),
supervised_keys=("image", "label"),
homepage=_HOMEPAGE,
task_templates=[ImageClassification(image_file_path_column="image", label_column="label", labels=_NAMES)],
citation=_CITATION,
license=_LICENSE,
)
Expand Down
6 changes: 6 additions & 0 deletions src/datasets/utils/mock_download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,9 @@ def delete_extracted_files(self):

def manage_extracted_files(self):
pass

def iter_archive(self, path):
path = Path(path)
for file_path in path.rglob("*"):
if file_path.is_file() and not file_path.name.startswith(".") and not file_path.name.startswith("__"):
yield file_path.relative_to(path).as_posix(), file_path.open("rb")
5 changes: 1 addition & 4 deletions src/datasets/utils/streaming_download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,7 @@ def iter_archive(self, urlpath: str):
continue
if file_path is None:
continue
if "/" not in file_path and file_path.startswith("__") and file_path.endswith("__"):
# skipping metadata
continue
if os.path.basename(file_path).startswith("."):
if os.path.basename(file_path).startswith(".") or os.path.basename(file_path).startswith("__"):
# skipping hidden files
continue
file_obj = stream.extractfile(tarinfo)
Expand Down

1 comment on commit 2c1b6fd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show benchmarks

PyArrow==3.0.0

Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.011884 / 0.011353 (0.000531) 0.004792 / 0.011008 (-0.006216) 0.044083 / 0.038508 (0.005575) 0.042133 / 0.023109 (0.019024) 0.405930 / 0.275898 (0.130032) 0.434845 / 0.323480 (0.111365) 0.009384 / 0.007986 (0.001398) 0.006183 / 0.004328 (0.001855) 0.012417 / 0.004250 (0.008167) 0.043882 / 0.037052 (0.006829) 0.405550 / 0.258489 (0.147061) 0.431075 / 0.293841 (0.137234) 0.038158 / 0.128546 (-0.090388) 0.013446 / 0.075646 (-0.062200) 0.382417 / 0.419271 (-0.036855) 0.064547 / 0.043533 (0.021015) 0.387345 / 0.255139 (0.132207) 0.419666 / 0.283200 (0.136466) 0.100506 / 0.141683 (-0.041177) 2.272079 / 1.452155 (0.819924) 2.332647 / 1.492716 (0.839930)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.241208 / 0.018006 (0.223201) 0.595908 / 0.000490 (0.595419) 0.007663 / 0.000200 (0.007463) 0.000139 / 0.000054 (0.000085)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.047539 / 0.037411 (0.010128) 0.028909 / 0.014526 (0.014383) 0.033795 / 0.176557 (-0.142762) 0.152589 / 0.737135 (-0.584547) 0.035698 / 0.296338 (-0.260641)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.569750 / 0.215209 (0.354541) 5.688826 / 2.077655 (3.611171) 2.688993 / 1.504120 (1.184873) 2.246578 / 1.541195 (0.705383) 2.161118 / 1.468490 (0.692628) 0.595214 / 4.584777 (-3.989563) 6.972369 / 3.745712 (3.226657) 1.574832 / 5.269862 (-3.695030) 1.484080 / 4.565676 (-3.081597) 0.076058 / 0.424275 (-0.348217) 0.006281 / 0.007607 (-0.001326) 0.721083 / 0.226044 (0.495039) 6.934394 / 2.268929 (4.665466) 3.187528 / 55.444624 (-52.257096) 2.582972 / 6.876477 (-4.293505) 2.568752 / 2.142072 (0.426679) 0.757236 / 4.805227 (-4.047991) 0.166897 / 6.500664 (-6.333767) 0.066681 / 0.075469 (-0.008788)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.215441 / 1.841788 (-0.626347) 16.283055 / 8.074308 (8.208747) 35.780740 / 10.191392 (25.589348) 0.945134 / 0.680424 (0.264710) 0.699442 / 0.534201 (0.165241) 0.305079 / 0.579283 (-0.274204) 0.767245 / 0.434364 (0.332881) 0.238913 / 0.540337 (-0.301424) 0.271085 / 1.386936 (-1.115851)
PyArrow==latest
Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.011420 / 0.011353 (0.000068) 0.005820 / 0.011008 (-0.005188) 0.051481 / 0.038508 (0.012973) 0.041612 / 0.023109 (0.018503) 0.394115 / 0.275898 (0.118217) 0.432518 / 0.323480 (0.109038) 0.009458 / 0.007986 (0.001472) 0.006995 / 0.004328 (0.002666) 0.011747 / 0.004250 (0.007497) 0.047984 / 0.037052 (0.010932) 0.423157 / 0.258489 (0.164668) 0.429709 / 0.293841 (0.135868) 0.037466 / 0.128546 (-0.091080) 0.012313 / 0.075646 (-0.063333) 0.345367 / 0.419271 (-0.073904) 0.071648 / 0.043533 (0.028116) 0.392722 / 0.255139 (0.137583) 0.439605 / 0.283200 (0.156405) 0.102206 / 0.141683 (-0.039477) 2.348037 / 1.452155 (0.895882) 2.654634 / 1.492716 (1.161917)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.383857 / 0.018006 (0.365851) 0.530693 / 0.000490 (0.530203) 0.053476 / 0.000200 (0.053277) 0.000575 / 0.000054 (0.000520)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.044414 / 0.037411 (0.007002) 0.028761 / 0.014526 (0.014236) 0.030528 / 0.176557 (-0.146028) 0.148797 / 0.737135 (-0.588338) 0.033235 / 0.296338 (-0.263103)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.564222 / 0.215209 (0.349013) 5.358298 / 2.077655 (3.280643) 2.627187 / 1.504120 (1.123067) 2.247844 / 1.541195 (0.706649) 2.219433 / 1.468490 (0.750943) 0.565186 / 4.584777 (-4.019591) 7.385004 / 3.745712 (3.639292) 1.580351 / 5.269862 (-3.689511) 1.471767 / 4.565676 (-3.093910) 0.065055 / 0.424275 (-0.359220) 0.005891 / 0.007607 (-0.001716) 0.670489 / 0.226044 (0.444445) 6.856257 / 2.268929 (4.587329) 3.333010 / 55.444624 (-52.111615) 2.689351 / 6.876477 (-4.187126) 2.650354 / 2.142072 (0.508281) 0.741639 / 4.805227 (-4.063588) 0.160563 / 6.500664 (-6.340101) 0.068788 / 0.075469 (-0.006681)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.207693 / 1.841788 (-0.634095) 16.354460 / 8.074308 (8.280152) 37.001429 / 10.191392 (26.810037) 1.012571 / 0.680424 (0.332148) 0.703244 / 0.534201 (0.169043) 0.296165 / 0.579283 (-0.283119) 0.781392 / 0.434364 (0.347028) 0.259832 / 0.540337 (-0.280506) 0.278761 / 1.386936 (-1.108176)

CML watermark

Please sign in to comment.