Datasets:
Tasks:
Image Classification
License:
parquet-converter
commited on
Commit
•
fdcf836
1
Parent(s):
68b2211
Update parquet files
Browse files- .gitattributes +0 -38
- .gitignore +0 -2
- README.md +0 -67
- credits.csv +0 -0
- images.zip → default/snacks-test.parquet +2 -2
- default/snacks-train.parquet +3 -0
- default/snacks-validation.parquet +3 -0
- snacks.py +0 -86
.gitattributes
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
26 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
29 |
-
# Audio files - uncompressed
|
30 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
33 |
-
# Audio files - compressed
|
34 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
36 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
37 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
38 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.gitignore
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
.DS_Store
|
2 |
-
|
|
|
|
|
|
README.md
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
---
|
2 |
-
pretty_name: Snacks
|
3 |
-
task_categories:
|
4 |
-
- image-classification
|
5 |
-
- computer-vision
|
6 |
-
license: cc-by-4.0
|
7 |
-
---
|
8 |
-
|
9 |
-
# Dataset Card for Snacks
|
10 |
-
|
11 |
-
## Dataset Summary
|
12 |
-
|
13 |
-
This is a dataset of 20 different types of snack foods that accompanies the book [Machine Learning by Tutorials](https://www.raywenderlich.com/books/machine-learning-by-tutorials/v2.0).
|
14 |
-
|
15 |
-
The images were taken from the [Google Open Images dataset](https://storage.googleapis.com/openimages/web/index.html), release 2017_11.
|
16 |
-
|
17 |
-
## Dataset Structure
|
18 |
-
|
19 |
-
Number of images in the train/validation/test splits:
|
20 |
-
|
21 |
-
```nohighlight
|
22 |
-
train 4838
|
23 |
-
val 955
|
24 |
-
test 952
|
25 |
-
total 6745
|
26 |
-
```
|
27 |
-
|
28 |
-
Total images in each category:
|
29 |
-
|
30 |
-
```nohighlight
|
31 |
-
apple 350
|
32 |
-
banana 350
|
33 |
-
cake 349
|
34 |
-
candy 349
|
35 |
-
carrot 349
|
36 |
-
cookie 349
|
37 |
-
doughnut 350
|
38 |
-
grape 350
|
39 |
-
hot dog 350
|
40 |
-
ice cream 350
|
41 |
-
juice 350
|
42 |
-
muffin 348
|
43 |
-
orange 349
|
44 |
-
pineapple 340
|
45 |
-
popcorn 260
|
46 |
-
pretzel 204
|
47 |
-
salad 350
|
48 |
-
strawberry 348
|
49 |
-
waffle 350
|
50 |
-
watermelon 350
|
51 |
-
```
|
52 |
-
|
53 |
-
To save space in the download, the images were resized so that their smallest side is 256 pixels. All EXIF information was removed.
|
54 |
-
|
55 |
-
### Data Splits
|
56 |
-
|
57 |
-
Train, Test, Validation
|
58 |
-
|
59 |
-
## Licensing Information
|
60 |
-
|
61 |
-
Just like the images from Google Open Images, the snacks dataset is licensed under the terms of the Creative Commons license.
|
62 |
-
|
63 |
-
The images are listed as having a [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) license.
|
64 |
-
|
65 |
-
The annotations are licensed by Google Inc. under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.
|
66 |
-
|
67 |
-
The **credits.csv** file contains the original URL, author information and license for each image.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
credits.csv
DELETED
The diff for this file is too large to render.
See raw diff
|
|
images.zip → default/snacks-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39f51e4e3efa990edcf437df3f6e0516dfa22e5eb78383f64121e87136fafa8a
|
3 |
+
size 14917207
|
default/snacks-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64a2161af57d7bff146701a8317f9b4eec500eafdf00fdea23c5933d3447bf40
|
3 |
+
size 76320303
|
default/snacks-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:386340d00792bfe492be32e4288d1f2ac258d94ec595f48f446395e02a72ba1d
|
3 |
+
size 15132175
|
snacks.py
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
"""Snacks Data Set"""
|
3 |
-
|
4 |
-
import os
|
5 |
-
|
6 |
-
import datasets
|
7 |
-
from datasets.tasks import ImageClassification
|
8 |
-
|
9 |
-
|
10 |
-
_CITATION = """
|
11 |
-
@article{OpenImages2,
|
12 |
-
title={OpenImages: A public dataset for large-scale multi-label and multi-class image classification.},
|
13 |
-
author={Krasin, Ivan and Duerig, Tom and Alldrin, Neil and Ferrari, Vittorio and Abu-El-Haija, Sami and Kuznetsova, Alina and Rom, Hassan and Uijlings, Jasper and Popov, Stefan and Kamali, Shahab and Malloci, Matteo and Pont-Tuset, Jordi and Veit, Andreas and Belongie, Serge and Gomes, Victor and Gupta, Abhinav and Sun, Chen and Chechik, Gal and Cai, David and Feng, Zheyun and Narayanan, Dhyanesh and Murphy, Kevin},
|
14 |
-
journal={Dataset available from https://storage.googleapis.com/openimages/web/index.html},
|
15 |
-
year={2017}
|
16 |
-
}
|
17 |
-
"""
|
18 |
-
|
19 |
-
_DESCRIPTION = "This is a dataset of 20 different types of snack foods that accompanies the book Machine Learning by Tutorials, https://www.raywenderlich.com/books/machine-learning-by-tutorials/v2.0 — Based on images from Google Open Images dataset."
|
20 |
-
|
21 |
-
_HOMEPAGE = "https://huggingface.co/datasets/Matthijs/snacks/"
|
22 |
-
|
23 |
-
_LICENSE = "cc-by-4.0"
|
24 |
-
|
25 |
-
_IMAGES_URL = "https://huggingface.co/datasets/Matthijs/snacks/resolve/main/images.zip"
|
26 |
-
|
27 |
-
_NAMES = ["apple", "banana", "cake", "candy", "carrot", "cookie",
|
28 |
-
"doughnut", "grape", "hot dog", "ice cream", "juice",
|
29 |
-
"muffin", "orange", "pineapple", "popcorn", "pretzel",
|
30 |
-
"salad", "strawberry", "waffle", "watermelon"]
|
31 |
-
|
32 |
-
|
33 |
-
class Snacks(datasets.GeneratorBasedBuilder):
|
34 |
-
"""Snacks Data Set"""
|
35 |
-
|
36 |
-
BUILDER_CONFIGS = [
|
37 |
-
datasets.BuilderConfig(
|
38 |
-
name="default",
|
39 |
-
version=datasets.Version("0.0.1", ""),
|
40 |
-
description="",
|
41 |
-
)
|
42 |
-
]
|
43 |
-
|
44 |
-
def _info(self):
|
45 |
-
return datasets.DatasetInfo(
|
46 |
-
description=_DESCRIPTION,
|
47 |
-
features=datasets.Features(
|
48 |
-
{
|
49 |
-
#"image_file_path": datasets.Value("string"),
|
50 |
-
"image": datasets.Image(),
|
51 |
-
"label": datasets.features.ClassLabel(names=_NAMES),
|
52 |
-
}
|
53 |
-
),
|
54 |
-
supervised_keys=("image", "label"),
|
55 |
-
homepage=_HOMEPAGE,
|
56 |
-
citation=_CITATION,
|
57 |
-
license=_LICENSE,
|
58 |
-
task_templates=ImageClassification(image_column="image", label_column="label"),
|
59 |
-
)
|
60 |
-
|
61 |
-
def _split_generators(self, dl_manager):
|
62 |
-
archive = os.path.join(dl_manager.download_and_extract(_IMAGES_URL), "data")
|
63 |
-
train_path = os.path.join(archive, "train")
|
64 |
-
test_path = os.path.join(archive, "test")
|
65 |
-
val_path = os.path.join(archive, "val")
|
66 |
-
|
67 |
-
return [
|
68 |
-
datasets.SplitGenerator(
|
69 |
-
name=datasets.Split.TRAIN, gen_kwargs={"files": dl_manager.iter_files(train_path)}
|
70 |
-
),
|
71 |
-
datasets.SplitGenerator(
|
72 |
-
name=datasets.Split.TEST, gen_kwargs={"files": dl_manager.iter_files(test_path)}
|
73 |
-
),
|
74 |
-
datasets.SplitGenerator(
|
75 |
-
name=datasets.Split.VALIDATION, gen_kwargs={"files": dl_manager.iter_files(val_path)}
|
76 |
-
),
|
77 |
-
]
|
78 |
-
|
79 |
-
def _generate_examples(self, files):
|
80 |
-
for i, file in enumerate(files):
|
81 |
-
if os.path.basename(file).endswith(".jpg"):
|
82 |
-
yield str(i), {
|
83 |
-
#"image_file_path": file,
|
84 |
-
"image": file,
|
85 |
-
"label": os.path.basename(os.path.dirname(file)).lower(),
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|