Spaces:
Runtime error
Runtime error
Add default tags
Browse files
app.py
CHANGED
@@ -72,7 +72,9 @@ def run(
|
|
72 |
general_tags: list[str],
|
73 |
hair_color_tags: list[str],
|
74 |
hair_style_tags: list[str],
|
|
|
75 |
image_color_tags: list[str],
|
|
|
76 |
additional_tags: str,
|
77 |
score_threshold: float,
|
78 |
start_index: int,
|
@@ -87,10 +89,11 @@ def run(
|
|
87 |
deepdanbooru_predictions: np.ndarray,
|
88 |
) -> tuple[int, np.ndarray, np.ndarray]:
|
89 |
hair_color_tags = [f'{color}_hair' for color in hair_color_tags]
|
|
|
90 |
additional_tags = additional_tags.split(',')
|
91 |
|
92 |
-
tags = general_tags + hair_color_tags + hair_style_tags +
|
93 |
-
|
94 |
tag_indices = [
|
95 |
deepdanbooru_tag_dict[tag] for tag in tags
|
96 |
if tag in deepdanbooru_tag_dict
|
@@ -162,6 +165,7 @@ def main():
|
|
162 |
'1boy',
|
163 |
'multiple_girls',
|
164 |
'multiple_boys',
|
|
|
165 |
],
|
166 |
label='General'),
|
167 |
gr.inputs.CheckboxGroup([
|
@@ -186,16 +190,40 @@ def main():
|
|
186 |
'long_hair',
|
187 |
'medium_hair',
|
188 |
'messy_hair',
|
|
|
189 |
'short_hair',
|
190 |
'straight_hair',
|
191 |
'twintails',
|
192 |
],
|
193 |
label='Hair Style'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
gr.inputs.CheckboxGroup([
|
195 |
'greyscale',
|
196 |
'monochrome',
|
197 |
],
|
198 |
label='Image Color'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
gr.inputs.Textbox(label='Additional Tags'),
|
200 |
gr.inputs.Slider(0,
|
201 |
1,
|
|
|
72 |
general_tags: list[str],
|
73 |
hair_color_tags: list[str],
|
74 |
hair_style_tags: list[str],
|
75 |
+
eye_color_tags: list[str],
|
76 |
image_color_tags: list[str],
|
77 |
+
other_tags: list[str],
|
78 |
additional_tags: str,
|
79 |
score_threshold: float,
|
80 |
start_index: int,
|
|
|
89 |
deepdanbooru_predictions: np.ndarray,
|
90 |
) -> tuple[int, np.ndarray, np.ndarray]:
|
91 |
hair_color_tags = [f'{color}_hair' for color in hair_color_tags]
|
92 |
+
eye_color_tags = [f'{color}_eyes' for color in eye_color_tags]
|
93 |
additional_tags = additional_tags.split(',')
|
94 |
|
95 |
+
tags = general_tags + hair_color_tags + hair_style_tags + \
|
96 |
+
eye_color_tags + image_color_tags + other_tags + additional_tags
|
97 |
tag_indices = [
|
98 |
deepdanbooru_tag_dict[tag] for tag in tags
|
99 |
if tag in deepdanbooru_tag_dict
|
|
|
165 |
'1boy',
|
166 |
'multiple_girls',
|
167 |
'multiple_boys',
|
168 |
+
'looking_at_viewer',
|
169 |
],
|
170 |
label='General'),
|
171 |
gr.inputs.CheckboxGroup([
|
|
|
190 |
'long_hair',
|
191 |
'medium_hair',
|
192 |
'messy_hair',
|
193 |
+
'ponytail',
|
194 |
'short_hair',
|
195 |
'straight_hair',
|
196 |
'twintails',
|
197 |
],
|
198 |
label='Hair Style'),
|
199 |
+
gr.inputs.CheckboxGroup([
|
200 |
+
'aqua',
|
201 |
+
'black',
|
202 |
+
'blue',
|
203 |
+
'brown',
|
204 |
+
'green',
|
205 |
+
'grey',
|
206 |
+
'orange',
|
207 |
+
'pink',
|
208 |
+
'purple',
|
209 |
+
'red',
|
210 |
+
'white',
|
211 |
+
'yellow',
|
212 |
+
],
|
213 |
+
label='Eye Color'),
|
214 |
gr.inputs.CheckboxGroup([
|
215 |
'greyscale',
|
216 |
'monochrome',
|
217 |
],
|
218 |
label='Image Color'),
|
219 |
+
gr.inputs.CheckboxGroup([
|
220 |
+
'animal_ears',
|
221 |
+
'closed_eyes',
|
222 |
+
'full_body',
|
223 |
+
'hat',
|
224 |
+
'smile',
|
225 |
+
],
|
226 |
+
label='Others'),
|
227 |
gr.inputs.Textbox(label='Additional Tags'),
|
228 |
gr.inputs.Slider(0,
|
229 |
1,
|