Datasets:
Tasks:
Image Classification
Modalities:
Image
Formats:
parquet
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
10K - 100K
License:
Commit
•
b5ae358
1
Parent(s):
3f09f82
Convert dataset to Parquet (#7)
Browse files- Convert dataset to Parquet (61bec6cba2259a0eaf12025124bcda44a93fb8b3)
- Delete loading script (b3c46ce6b19fda7884ce2dfab7886e1dcc88e0e2)
- README.md +8 -3
- cats_vs_dogs.py +0 -80
- data/train-00000-of-00002.parquet +3 -0
- data/train-00001-of-00002.parquet +3 -0
README.md
CHANGED
@@ -31,10 +31,15 @@ dataset_info:
|
|
31 |
'1': dog
|
32 |
splits:
|
33 |
- name: train
|
34 |
-
num_bytes:
|
35 |
num_examples: 23410
|
36 |
-
download_size:
|
37 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
38 |
---
|
39 |
|
40 |
# Dataset Card for Cats Vs. Dogs
|
|
|
31 |
'1': dog
|
32 |
splits:
|
33 |
- name: train
|
34 |
+
num_bytes: 667071605.79
|
35 |
num_examples: 23410
|
36 |
+
download_size: 721642420
|
37 |
+
dataset_size: 667071605.79
|
38 |
+
configs:
|
39 |
+
- config_name: default
|
40 |
+
data_files:
|
41 |
+
- split: train
|
42 |
+
path: data/train-*
|
43 |
---
|
44 |
|
45 |
# Dataset Card for Cats Vs. Dogs
|
cats_vs_dogs.py
DELETED
@@ -1,80 +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 |
-
"""The Microsoft Cats vs. Dogs dataset"""
|
16 |
-
|
17 |
-
import os
|
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_5340.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 |
-
VERSION = datasets.Version("1.0.0")
|
48 |
-
|
49 |
-
def _info(self):
|
50 |
-
return datasets.DatasetInfo(
|
51 |
-
description=_DESCRIPTION,
|
52 |
-
features=datasets.Features(
|
53 |
-
{
|
54 |
-
"image": datasets.Image(),
|
55 |
-
"labels": datasets.features.ClassLabel(names=["cat", "dog"]),
|
56 |
-
}
|
57 |
-
),
|
58 |
-
supervised_keys=("image", "labels"),
|
59 |
-
task_templates=[ImageClassification(image_column="image", label_column="labels")],
|
60 |
-
homepage=_HOMEPAGE,
|
61 |
-
citation=_CITATION,
|
62 |
-
)
|
63 |
-
|
64 |
-
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
65 |
-
images_path = os.path.join(dl_manager.download_and_extract(_URL), "PetImages")
|
66 |
-
return [
|
67 |
-
datasets.SplitGenerator(
|
68 |
-
name=datasets.Split.TRAIN, gen_kwargs={"files": dl_manager.iter_files([images_path])}
|
69 |
-
),
|
70 |
-
]
|
71 |
-
|
72 |
-
def _generate_examples(self, files):
|
73 |
-
for i, file in enumerate(files):
|
74 |
-
if os.path.basename(file).endswith(".jpg"):
|
75 |
-
with open(file, "rb") as f:
|
76 |
-
if b"JFIF" in f.peek(10):
|
77 |
-
yield str(i), {
|
78 |
-
"image": file,
|
79 |
-
"labels": os.path.basename(os.path.dirname(file)).lower(),
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/train-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d2a40bc460fc9ac12a4a0edbe44476cbed5dd0829a8cbc08af9bcbbea5cc9620
|
3 |
+
size 330245704
|
data/train-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:568276cea0e7ee4173847ab3db33d3b64c3ec8fd061e2f3b336d0f48d791421e
|
3 |
+
size 391396716
|