Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
found
Annotations Creators:
crowdsourced
Tags:
License:
albertvillanova HF staff commited on
Commit
0b27149
1 Parent(s): d5fb971

Convert dataset to Parquet (#6)

Browse files

- Convert dataset to Parquet (e025e6419806783509e14ac5648d777c9de2df0f)
- Delete loading script (3c990e07c1af87bb8db3439efce68199575ea40f)
- Delete legacy dataset_infos.json (2b98fdb5ca486858b980072b9b45e02115f5f3d5)

README.md CHANGED
@@ -19,6 +19,7 @@ task_ids: []
19
  paperswithcode_id: cifar-10
20
  pretty_name: Cifar10
21
  dataset_info:
 
22
  features:
23
  - name: img
24
  dtype: image
@@ -36,16 +37,23 @@ dataset_info:
36
  '7': horse
37
  '8': ship
38
  '9': truck
39
- config_name: plain_text
40
  splits:
41
  - name: train
42
- num_bytes: 113854600
43
  num_examples: 50000
44
  - name: test
45
- num_bytes: 22772838
46
  num_examples: 10000
47
- download_size: 170498071
48
- dataset_size: 136627438
 
 
 
 
 
 
 
 
49
  ---
50
 
51
  # Dataset Card for CIFAR-10
19
  paperswithcode_id: cifar-10
20
  pretty_name: Cifar10
21
  dataset_info:
22
+ config_name: plain_text
23
  features:
24
  - name: img
25
  dtype: image
37
  '7': horse
38
  '8': ship
39
  '9': truck
 
40
  splits:
41
  - name: train
42
+ num_bytes: 113648310.0
43
  num_examples: 50000
44
  - name: test
45
+ num_bytes: 22731580.0
46
  num_examples: 10000
47
+ download_size: 143646105
48
+ dataset_size: 136379890.0
49
+ configs:
50
+ - config_name: plain_text
51
+ data_files:
52
+ - split: train
53
+ path: plain_text/train-*
54
+ - split: test
55
+ path: plain_text/test-*
56
+ default: true
57
  ---
58
 
59
  # Dataset Card for CIFAR-10
cifar10.py DELETED
@@ -1,121 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
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
-
16
- # Lint as: python3
17
- """CIFAR-10 Data Set"""
18
-
19
-
20
- import pickle
21
-
22
- import numpy as np
23
-
24
- import datasets
25
- from datasets.tasks import ImageClassification
26
-
27
-
28
- _CITATION = """\
29
- @TECHREPORT{Krizhevsky09learningmultiple,
30
- author = {Alex Krizhevsky},
31
- title = {Learning multiple layers of features from tiny images},
32
- institution = {},
33
- year = {2009}
34
- }
35
- """
36
-
37
- _DESCRIPTION = """\
38
- The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images
39
- per class. There are 50000 training images and 10000 test images.
40
- """
41
-
42
- _DATA_URL = "https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz"
43
-
44
- _NAMES = [
45
- "airplane",
46
- "automobile",
47
- "bird",
48
- "cat",
49
- "deer",
50
- "dog",
51
- "frog",
52
- "horse",
53
- "ship",
54
- "truck",
55
- ]
56
-
57
-
58
- class Cifar10(datasets.GeneratorBasedBuilder):
59
- """CIFAR-10 Data Set"""
60
-
61
- BUILDER_CONFIGS = [
62
- datasets.BuilderConfig(
63
- name="plain_text",
64
- version=datasets.Version("1.0.0", ""),
65
- description="Plain text import of CIFAR-10 Data Set",
66
- )
67
- ]
68
-
69
- def _info(self):
70
- return datasets.DatasetInfo(
71
- description=_DESCRIPTION,
72
- features=datasets.Features(
73
- {
74
- "img": datasets.Image(),
75
- "label": datasets.features.ClassLabel(names=_NAMES),
76
- }
77
- ),
78
- supervised_keys=("img", "label"),
79
- homepage="https://www.cs.toronto.edu/~kriz/cifar.html",
80
- citation=_CITATION,
81
- task_templates=ImageClassification(image_column="img", label_column="label"),
82
- )
83
-
84
- def _split_generators(self, dl_manager):
85
- archive = dl_manager.download(_DATA_URL)
86
-
87
- return [
88
- datasets.SplitGenerator(
89
- name=datasets.Split.TRAIN, gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "train"}
90
- ),
91
- datasets.SplitGenerator(
92
- name=datasets.Split.TEST, gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "test"}
93
- ),
94
- ]
95
-
96
- def _generate_examples(self, files, split):
97
- """This function returns the examples in the raw (text) form."""
98
-
99
- if split == "train":
100
- batches = ["data_batch_1", "data_batch_2", "data_batch_3", "data_batch_4", "data_batch_5"]
101
-
102
- if split == "test":
103
- batches = ["test_batch"]
104
- batches = [f"cifar-10-batches-py/{filename}" for filename in batches]
105
-
106
- for path, fo in files:
107
-
108
- if path in batches:
109
- dict = pickle.load(fo, encoding="bytes")
110
-
111
- labels = dict[b"labels"]
112
- images = dict[b"data"]
113
-
114
- for idx, _ in enumerate(images):
115
-
116
- img_reshaped = np.transpose(np.reshape(images[idx], (3, 32, 32)), (1, 2, 0))
117
-
118
- yield f"{path}_{idx}", {
119
- "img": img_reshaped,
120
- "label": labels[idx],
121
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"plain_text": {"description": "The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images\nper class. There are 50000 training images and 10000 test images.\n", "citation": "@TECHREPORT{Krizhevsky09learningmultiple,\n author = {Alex Krizhevsky},\n title = {Learning multiple layers of features from tiny images},\n institution = {},\n year = {2009}\n}\n", "homepage": "https://www.cs.toronto.edu/~kriz/cifar.html", "license": "", "features": {"img": {"id": null, "_type": "Image"}, "label": {"num_classes": 10, "names": ["airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", "ship", "truck"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "img", "output": "label"}, "task_templates": [{"task": "image-classification", "image_column": "img", "label_column": "label", "labels": ["airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", "ship", "truck"]}], "builder_name": "cifar10", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 113854600, "num_examples": 50000, "dataset_name": "cifar10"}, "test": {"name": "test", "num_bytes": 22772838, "num_examples": 10000, "dataset_name": "cifar10"}}, "download_checksums": {"https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz": {"num_bytes": 170498071, "checksum": "6d958be074577803d12ecdefd02955f39262c83c16fe9348329d7fe0b5c001ce"}}, "download_size": 170498071, "post_processing_size": null, "dataset_size": 136627438, "size_in_bytes": 307125509}}
 
plain_text/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:841389e6f2d64f28bf17310e430aebac20ec3ba611a3c5e231dc93c645ce84de
3
+ size 23940850
plain_text/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8428b53a88a11ac374111006708df51469e315a22ac6d66470afd9c78d2ae883
3
+ size 119705255