system HF staff commited on
Commit
d0a16ec
0 Parent(s):

Update files from the datasets library (from 1.12.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.12.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +177 -0
  3. cats_vs_dogs.py +81 -0
  4. dataset_infos.json +1 -0
  5. dummy/0.0.0/dummy_data.zip +3 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: Cats Vs- Dogs
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - other
19
+ task_ids:
20
+ - other-other-image-classification
21
+ ---
22
+
23
+ # Dataset Card for Cats Vs. Dogs
24
+
25
+ ## Table of Contents
26
+ - [Table of Contents](#table-of-contents)
27
+ - [Dataset Description](#dataset-description)
28
+ - [Dataset Summary](#dataset-summary)
29
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
30
+ - [Languages](#languages)
31
+ - [Dataset Structure](#dataset-structure)
32
+ - [Data Instances](#data-instances)
33
+ - [Data Fields](#data-fields)
34
+ - [Data Splits](#data-splits)
35
+ - [Dataset Creation](#dataset-creation)
36
+ - [Curation Rationale](#curation-rationale)
37
+ - [Source Data](#source-data)
38
+ - [Annotations](#annotations)
39
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
40
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
41
+ - [Social Impact of Dataset](#social-impact-of-dataset)
42
+ - [Discussion of Biases](#discussion-of-biases)
43
+ - [Other Known Limitations](#other-known-limitations)
44
+ - [Additional Information](#additional-information)
45
+ - [Dataset Curators](#dataset-curators)
46
+ - [Licensing Information](#licensing-information)
47
+ - [Citation Information](#citation-information)
48
+ - [Contributions](#contributions)
49
+
50
+ ## Dataset Description
51
+
52
+ - **Homepage:** [Cats vs Dogs Dataset](https://www.microsoft.com/en-us/download/details.aspx?id=54765)
53
+ - **Repository:** N/A
54
+ - **Paper:** [Paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2007/10/CCS2007.pdf)
55
+ - **Leaderboard:** N/A
56
+ - **Point of Contact:** N/A
57
+
58
+ ### Dataset Summary
59
+
60
+ A large set of images of cats and dogs. There are 1738 corrupted images that are dropped.
61
+
62
+ ### Supported Tasks and Leaderboards
63
+
64
+ - image-classification
65
+
66
+ ### Languages
67
+
68
+ English
69
+
70
+ ## Dataset Structure
71
+
72
+ ### Data Instances
73
+
74
+ A sample from the training set is provided below:
75
+
76
+ ```
77
+ {
78
+ 'image': '/root/.cache/huggingface/datasets/downloads/extracted/6e1e8c9052e9f3f7ecbcb4b90860668f81c1d36d86cc9606d49066f8da8bfb4f/PetImages/Cat/1.jpg',
79
+ 'label': 0
80
+ }
81
+ ```
82
+
83
+ ### Data Fields
84
+
85
+ The data instances have the following fields:
86
+
87
+ - `image_file_path`: a `string` filepath to an image.
88
+ - `labels`: an `int` classification label.
89
+
90
+ Class Label Mappings:
91
+
92
+ ```
93
+ {
94
+ "cat": 0,
95
+ "dog": 1,
96
+ }
97
+ ```
98
+
99
+ ### Data Splits
100
+
101
+
102
+ | | train |
103
+ |---------------|------:|
104
+ | # of examples | 23410 |
105
+
106
+ ## Dataset Creation
107
+
108
+ ### Curation Rationale
109
+
110
+ [More Information Needed]
111
+
112
+ ### Source Data
113
+
114
+ #### Initial Data Collection and Normalization
115
+
116
+ [More Information Needed]
117
+
118
+ #### Who are the source language producers?
119
+
120
+ [More Information Needed]
121
+
122
+ ### Annotations
123
+
124
+ #### Annotation process
125
+
126
+ [More Information Needed]
127
+
128
+ #### Who are the annotators?
129
+
130
+ [More Information Needed]
131
+
132
+ ### Personal and Sensitive Information
133
+
134
+ [More Information Needed]
135
+
136
+ ## Considerations for Using the Data
137
+
138
+ ### Social Impact of Dataset
139
+
140
+ [More Information Needed]
141
+
142
+ ### Discussion of Biases
143
+
144
+ [More Information Needed]
145
+
146
+ ### Other Known Limitations
147
+
148
+ [More Information Needed]
149
+
150
+ ## Additional Information
151
+
152
+ ### Dataset Curators
153
+
154
+ [More Information Needed]
155
+
156
+ ### Licensing Information
157
+
158
+ [More Information Needed]
159
+
160
+ ### Citation Information
161
+
162
+ ```
163
+ @Inproceedings (Conference){asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization,
164
+ author = {Elson, Jeremy and Douceur, John (JD) and Howell, Jon and Saul, Jared},
165
+ title = {Asirra: A CAPTCHA that Exploits Interest-Aligned Manual Image Categorization},
166
+ booktitle = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},
167
+ year = {2007},
168
+ month = {October},
169
+ publisher = {Association for Computing Machinery, Inc.},
170
+ url = {https://www.microsoft.com/en-us/research/publication/asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization/},
171
+ edition = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},
172
+ }
173
+ ```
174
+
175
+ ### Contributions
176
+
177
+ Thanks to [@nateraw](https://github.com/nateraw) for adding this dataset.
cats_vs_dogs.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """The Microsoft Cats vs. Dogs dataset"""
16
+
17
+ from pathlib import Path
18
+ from typing import List
19
+
20
+ import datasets
21
+ from datasets.tasks import ImageClassification
22
+
23
+
24
+ logger = datasets.logging.get_logger(__name__)
25
+
26
+ _URL = "https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_3367a.zip"
27
+
28
+ _HOMEPAGE = "https://www.microsoft.com/en-us/download/details.aspx?id=54765"
29
+
30
+ _DESCRIPTION = "A large set of images of cats and dogs. There are 1738 corrupted images that are dropped."
31
+
32
+ _CITATION = """\
33
+ @Inproceedings (Conference){asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization,
34
+ author = {Elson, Jeremy and Douceur, John (JD) and Howell, Jon and Saul, Jared},
35
+ title = {Asirra: A CAPTCHA that Exploits Interest-Aligned Manual Image Categorization},
36
+ booktitle = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},
37
+ year = {2007},
38
+ month = {October},
39
+ publisher = {Association for Computing Machinery, Inc.},
40
+ url = {https://www.microsoft.com/en-us/research/publication/asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization/},
41
+ edition = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},
42
+ }
43
+ """
44
+
45
+
46
+ class CatsVsDogs(datasets.GeneratorBasedBuilder):
47
+ def _info(self):
48
+ return datasets.DatasetInfo(
49
+ description=_DESCRIPTION,
50
+ features=datasets.Features(
51
+ {
52
+ "image_file_path": datasets.Value("string"),
53
+ "labels": datasets.features.ClassLabel(names=["cat", "dog"]),
54
+ }
55
+ ),
56
+ supervised_keys=("image_file_path", "labels"),
57
+ task_templates=[
58
+ ImageClassification(
59
+ image_file_path_column="image_file_path", label_column="labels", labels=["cat", "dog"]
60
+ )
61
+ ],
62
+ homepage=_HOMEPAGE,
63
+ citation=_CITATION,
64
+ )
65
+
66
+ def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
67
+ images_path = Path(dl_manager.download_and_extract(_URL)) / "PetImages"
68
+ return [
69
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"images_path": images_path}),
70
+ ]
71
+
72
+ def _generate_examples(self, images_path):
73
+ logger.info("generating examples from = %s", images_path)
74
+ for i, filepath in enumerate(images_path.glob("**/*.jpg")):
75
+ with filepath.open("rb") as f:
76
+ if b"JFIF" in f.peek(10):
77
+ yield str(i), {
78
+ "image_file_path": str(filepath),
79
+ "labels": filepath.parent.name.lower(),
80
+ }
81
+ continue
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "A large set of images of cats and dogs. There are 1738 corrupted images that are dropped.", "citation": "@Inproceedings (Conference){asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization,\n author = {Elson, Jeremy and Douceur, John (JD) and Howell, Jon and Saul, Jared},\n title = {Asirra: A CAPTCHA that Exploits Interest-Aligned Manual Image Categorization},\n booktitle = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},\n year = {2007},\n month = {October},\n publisher = {Association for Computing Machinery, Inc.},\n url = {https://www.microsoft.com/en-us/research/publication/asirra-a-captcha-that-exploits-interest-aligned-manual-image-categorization/},\n edition = {Proceedings of 14th ACM Conference on Computer and Communications Security (CCS)},\n}\n", "homepage": "https://www.microsoft.com/en-us/download/details.aspx?id=54765", "license": "", "features": {"image_file_path": {"dtype": "string", "id": null, "_type": "Value"}, "labels": {"num_classes": 2, "names": ["cat", "dog"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "image_file_path", "output": "labels"}, "task_templates": [{"task": "image-classification", "image_file_path_column": "image_file_path", "label_column": "labels", "labels": ["cat", "dog"]}], "builder_name": "cats_vs_dogs", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3701417, "num_examples": 23410, "dataset_name": "cats_vs_dogs"}}, "download_checksums": {"https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_3367a.zip": {"num_bytes": 824894548, "checksum": "f9553e426bd725354ed3a27e3c6920caadb55c835d1ebd880d2e56d3f1fbb22b"}}, "download_size": 824894548, "post_processing_size": null, "dataset_size": 3701417, "size_in_bytes": 828595965}}
dummy/0.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e223a4dfb617856f707511775f8446a7ac0a7474f0bfe61c27ca83b785ed6479
3
+ size 320129