add data
Browse files- .gitattributes +1 -0
- .gitignore +156 -0
- .vscode/settings.json +3 -0
- cartoonset10k.py +100 -0
- data/cartoonset10k.tgz +3 -0
- dataset_infos.json +39 -0
- poetry.lock +0 -0
- pyproject.toml +18 -0
.gitattributes
CHANGED
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
38 |
+
data/cartoonset10k.tgz filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
+
|
6 |
+
# C extensions
|
7 |
+
*.so
|
8 |
+
|
9 |
+
# Distribution / packaging
|
10 |
+
.Python
|
11 |
+
build/
|
12 |
+
develop-eggs/
|
13 |
+
dist/
|
14 |
+
downloads/
|
15 |
+
eggs/
|
16 |
+
.eggs/
|
17 |
+
lib/
|
18 |
+
lib64/
|
19 |
+
parts/
|
20 |
+
sdist/
|
21 |
+
var/
|
22 |
+
wheels/
|
23 |
+
share/python-wheels/
|
24 |
+
*.egg-info/
|
25 |
+
.installed.cfg
|
26 |
+
*.egg
|
27 |
+
MANIFEST
|
28 |
+
|
29 |
+
# PyInstaller
|
30 |
+
# Usually these files are written by a python script from a template
|
31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32 |
+
*.manifest
|
33 |
+
*.spec
|
34 |
+
|
35 |
+
# Installer logs
|
36 |
+
pip-log.txt
|
37 |
+
pip-delete-this-directory.txt
|
38 |
+
|
39 |
+
# Unit test / coverage reports
|
40 |
+
htmlcov/
|
41 |
+
.tox/
|
42 |
+
.nox/
|
43 |
+
.coverage
|
44 |
+
.coverage.*
|
45 |
+
.cache
|
46 |
+
nosetests.xml
|
47 |
+
coverage.xml
|
48 |
+
*.cover
|
49 |
+
*.py,cover
|
50 |
+
.hypothesis/
|
51 |
+
.pytest_cache/
|
52 |
+
cover/
|
53 |
+
|
54 |
+
# Translations
|
55 |
+
*.mo
|
56 |
+
*.pot
|
57 |
+
|
58 |
+
# Django stuff:
|
59 |
+
*.log
|
60 |
+
local_settings.py
|
61 |
+
db.sqlite3
|
62 |
+
db.sqlite3-journal
|
63 |
+
|
64 |
+
# Flask stuff:
|
65 |
+
instance/
|
66 |
+
.webassets-cache
|
67 |
+
|
68 |
+
# Scrapy stuff:
|
69 |
+
.scrapy
|
70 |
+
|
71 |
+
# Sphinx documentation
|
72 |
+
docs/_build/
|
73 |
+
|
74 |
+
# PyBuilder
|
75 |
+
.pybuilder/
|
76 |
+
target/
|
77 |
+
|
78 |
+
# Jupyter Notebook
|
79 |
+
.ipynb_checkpoints
|
80 |
+
|
81 |
+
# IPython
|
82 |
+
profile_default/
|
83 |
+
ipython_config.py
|
84 |
+
|
85 |
+
# pyenv
|
86 |
+
# For a library or package, you might want to ignore these files since the code is
|
87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
88 |
+
# .python-version
|
89 |
+
|
90 |
+
# pipenv
|
91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94 |
+
# install all needed dependencies.
|
95 |
+
#Pipfile.lock
|
96 |
+
|
97 |
+
# poetry
|
98 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
99 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
100 |
+
# commonly ignored for libraries.
|
101 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
102 |
+
#poetry.lock
|
103 |
+
|
104 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
105 |
+
__pypackages__/
|
106 |
+
|
107 |
+
# Celery stuff
|
108 |
+
celerybeat-schedule
|
109 |
+
celerybeat.pid
|
110 |
+
|
111 |
+
# SageMath parsed files
|
112 |
+
*.sage.py
|
113 |
+
|
114 |
+
# Environments
|
115 |
+
.env
|
116 |
+
.venv
|
117 |
+
env/
|
118 |
+
venv/
|
119 |
+
ENV/
|
120 |
+
env.bak/
|
121 |
+
venv.bak/
|
122 |
+
|
123 |
+
# Spyder project settings
|
124 |
+
.spyderproject
|
125 |
+
.spyproject
|
126 |
+
|
127 |
+
# Rope project settings
|
128 |
+
.ropeproject
|
129 |
+
|
130 |
+
# mkdocs documentation
|
131 |
+
/site
|
132 |
+
|
133 |
+
# mypy
|
134 |
+
.mypy_cache/
|
135 |
+
.dmypy.json
|
136 |
+
dmypy.json
|
137 |
+
|
138 |
+
# Pyre type checker
|
139 |
+
.pyre/
|
140 |
+
|
141 |
+
# pytype static type analyzer
|
142 |
+
.pytype/
|
143 |
+
|
144 |
+
# Cython debug symbols
|
145 |
+
cython_debug/
|
146 |
+
|
147 |
+
# PyCharm
|
148 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
149 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
150 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
151 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
152 |
+
#.idea/
|
153 |
+
|
154 |
+
# data files
|
155 |
+
/scratch.py
|
156 |
+
/test.py
|
.vscode/settings.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"python.formatting.provider": "black"
|
3 |
+
}
|
cartoonset10k.py
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Cartoonset-10k Data Set"""
|
2 |
+
|
3 |
+
|
4 |
+
import pickle
|
5 |
+
|
6 |
+
import numpy as np
|
7 |
+
import PIL.Image
|
8 |
+
|
9 |
+
|
10 |
+
import datasets
|
11 |
+
from datasets.tasks import ImageClassification
|
12 |
+
|
13 |
+
|
14 |
+
_CITATION = """\
|
15 |
+
@TECHREPORT{Krizhevsky09learningmultiple,
|
16 |
+
author = {Alex Krizhevsky},
|
17 |
+
title = {Learning multiple layers of features from tiny images},
|
18 |
+
institution = {},
|
19 |
+
year = {2009}
|
20 |
+
}
|
21 |
+
"""
|
22 |
+
|
23 |
+
_DESCRIPTION = """\
|
24 |
+
The Cartoonset-10k dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images
|
25 |
+
per class. There are 50000 training images and 10000 test images.
|
26 |
+
"""
|
27 |
+
|
28 |
+
_DATA_URL = "https://storage.cloud.google.com/cartoonset_public_files/cartoonset10k.tgz"
|
29 |
+
|
30 |
+
_NAMES = []
|
31 |
+
|
32 |
+
|
33 |
+
class Cartoonset10k(datasets.GeneratorBasedBuilder):
|
34 |
+
"""Cartoonset-10k Data Set"""
|
35 |
+
|
36 |
+
BUILDER_CONFIGS = [
|
37 |
+
datasets.BuilderConfig(
|
38 |
+
name="cartoonset10k",
|
39 |
+
version=datasets.Version("1.0.0", ""),
|
40 |
+
description="Plain text import of Cartoonset-10k Data Set",
|
41 |
+
)
|
42 |
+
]
|
43 |
+
|
44 |
+
def _info(self):
|
45 |
+
return datasets.DatasetInfo(
|
46 |
+
description=_DESCRIPTION,
|
47 |
+
features=datasets.Features(
|
48 |
+
{
|
49 |
+
"img": datasets.Image(),
|
50 |
+
# "label": datasets.features.ClassLabel(names=_NAMES),
|
51 |
+
}
|
52 |
+
),
|
53 |
+
supervised_keys=("img",),
|
54 |
+
homepage="https://www.cs.toronto.edu/~kriz/cifar.html",
|
55 |
+
citation=_CITATION,
|
56 |
+
# task_templates=ImageClassification(
|
57 |
+
# image_column="img", label_column="label"
|
58 |
+
# ),
|
59 |
+
)
|
60 |
+
|
61 |
+
def _split_generators(self, dl_manager):
|
62 |
+
print("URL:", _DATA_URL)
|
63 |
+
archive = dl_manager.download({"train": _DATA_URL})
|
64 |
+
|
65 |
+
print(archive)
|
66 |
+
exit()
|
67 |
+
|
68 |
+
return [
|
69 |
+
datasets.SplitGenerator(
|
70 |
+
name=datasets.Split.TRAIN,
|
71 |
+
gen_kwargs={
|
72 |
+
"files": dl_manager.iter_archive(archive),
|
73 |
+
"split": "train",
|
74 |
+
},
|
75 |
+
),
|
76 |
+
# datasets.SplitGenerator(
|
77 |
+
# name=datasets.Split.TEST, gen_kwargs={"files": dl_manager.iter_archive(archive), "split": "test"}
|
78 |
+
# ),
|
79 |
+
]
|
80 |
+
|
81 |
+
def _generate_examples(self, files, split):
|
82 |
+
"""This function returns the examples in the raw (text) form."""
|
83 |
+
|
84 |
+
# if split == "train":
|
85 |
+
# batches = ["data_batch_1", "data_batch_2", "data_batch_3", "data_batch_4", "data_batch_5"]
|
86 |
+
|
87 |
+
# if split == "test":
|
88 |
+
# batches = ["test_batch"]
|
89 |
+
# batches = [f"Cartoonset-10k-batches-py/{filename}" for filename in batches]
|
90 |
+
print("FILES", files)
|
91 |
+
|
92 |
+
path: str
|
93 |
+
for path, file_obj in files:
|
94 |
+
|
95 |
+
if path.endswith(".png"):
|
96 |
+
image = PIL.Image.open(path)
|
97 |
+
|
98 |
+
yield path, {
|
99 |
+
"img": np.asarray(image),
|
100 |
+
}
|
data/cartoonset10k.tgz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:902145ad5096af10ca9ee200b648e2a60e8b6b83dd2f4dc5356817988be8ff43
|
3 |
+
size 476635078
|
dataset_infos.json
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"plain_text": {
|
3 |
+
"description": "The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images\nper class. There are 20000 training images and 10000 test images.\n",
|
4 |
+
"citation": "@TECHREPORT{Krizhevsky09learningmultiple,\n author = {Alex Krizhevsky},\n title = {Learning multiple layers of features from tiny images},\n institution = {},\n year = {2009}\n}\n",
|
5 |
+
"homepage": "https://www.cs.toronto.edu/~kriz/cifar.html",
|
6 |
+
"license": "",
|
7 |
+
"features": {
|
8 |
+
"img": {
|
9 |
+
"id": null,
|
10 |
+
"_type": "Image"
|
11 |
+
}
|
12 |
+
},
|
13 |
+
"post_processed": null,
|
14 |
+
"supervised_keys": {
|
15 |
+
"input": "img",
|
16 |
+
"output": "label"
|
17 |
+
},
|
18 |
+
"builder_name": "cifar10",
|
19 |
+
"version": {
|
20 |
+
"version_str": "1.0.0",
|
21 |
+
"description": "",
|
22 |
+
"major": 1,
|
23 |
+
"minor": 0,
|
24 |
+
"patch": 0
|
25 |
+
},
|
26 |
+
"splits": {
|
27 |
+
"train": {
|
28 |
+
"name": "train",
|
29 |
+
"num_bytes": 476635078,
|
30 |
+
"num_examples": 20000,
|
31 |
+
"dataset_name": "cifar10"
|
32 |
+
}
|
33 |
+
},
|
34 |
+
"download_size": 476635078,
|
35 |
+
"post_processing_size": null,
|
36 |
+
"dataset_size": 136627438,
|
37 |
+
"size_in_bytes": 307125509
|
38 |
+
}
|
39 |
+
}
|
poetry.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.poetry]
|
2 |
+
name = "cartoonset10k"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = ""
|
5 |
+
authors = ["Cristian Garcia <[email protected]>"]
|
6 |
+
|
7 |
+
[tool.poetry.dependencies]
|
8 |
+
python = "^3.8"
|
9 |
+
datasets = "^1.18.4"
|
10 |
+
numpy = "^1.22.3"
|
11 |
+
Pillow = "^9.0.1"
|
12 |
+
|
13 |
+
[tool.poetry.dev-dependencies]
|
14 |
+
black = {version = "^22.1.0", allow-prereleases = true}
|
15 |
+
|
16 |
+
[build-system]
|
17 |
+
requires = ["poetry-core>=1.0.0"]
|
18 |
+
build-backend = "poetry.core.masonry.api"
|