Commit
·
956b3b5
1
Parent(s):
f5fc4d8
feat: graffiti-database.com palette
Browse files- README.md +3 -3
- data/graffiti-database.com/metadata.jsonl +2 -2
- graffiti.py +10 -1
README.md
CHANGED
@@ -9,10 +9,10 @@ dataset_info:
|
|
9 |
dtype: string
|
10 |
splits:
|
11 |
- name: train
|
12 |
-
num_bytes:
|
13 |
num_examples: 77478
|
14 |
-
download_size:
|
15 |
-
dataset_size:
|
16 |
---
|
17 |
# Dataset Card for Graffiti
|
18 |
|
|
|
9 |
dtype: string
|
10 |
splits:
|
11 |
- name: train
|
12 |
+
num_bytes: 8373338923
|
13 |
num_examples: 77478
|
14 |
+
download_size: 16124853637
|
15 |
+
dataset_size: 8373338923
|
16 |
---
|
17 |
# Dataset Card for Graffiti
|
18 |
|
data/graffiti-database.com/metadata.jsonl
CHANGED
@@ -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:5da51677a29f6db9ce29b0e07368e9c2efd5e36e15d1342db420f5a2270275e0
|
3 |
+
size 21153581
|
graffiti.py
CHANGED
@@ -119,11 +119,20 @@ class Graffiti(datasets.GeneratorBasedBuilder):
|
|
119 |
conditioning_file_obj = conditioning_file[1]
|
120 |
|
121 |
text = data["caption"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
if data["artist"] != None:
|
123 |
# text += ", with text " + data["artist"]
|
124 |
-
text += ",
|
125 |
if data["city"] != None:
|
126 |
text += ", located in " + data["city"]
|
|
|
127 |
yield idx, {
|
128 |
"image": {"path": file_path, "bytes": file_obj.read()},
|
129 |
"conditioning_image": {"path": conditioning_file_path, "bytes": conditioning_file_obj.read()},
|
|
|
119 |
conditioning_file_obj = conditioning_file[1]
|
120 |
|
121 |
text = data["caption"]
|
122 |
+
if data["palette"] != None:
|
123 |
+
text += ", in the colors "
|
124 |
+
colors = []
|
125 |
+
for color in data["palette"]:
|
126 |
+
if color[1] in colors:
|
127 |
+
continue
|
128 |
+
colors.append(color[1])
|
129 |
+
text += " and ".join(colors)
|
130 |
if data["artist"] != None:
|
131 |
# text += ", with text " + data["artist"]
|
132 |
+
text += ", by " + data["artist"]
|
133 |
if data["city"] != None:
|
134 |
text += ", located in " + data["city"]
|
135 |
+
|
136 |
yield idx, {
|
137 |
"image": {"path": file_path, "bytes": file_obj.read()},
|
138 |
"conditioning_image": {"path": conditioning_file_path, "bytes": conditioning_file_obj.read()},
|