hysts HF Staff commited on
Commit
cef99be
·
1 Parent(s): a49cb7c

Return missing tags

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -94,6 +94,8 @@ def run(
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
@@ -128,7 +130,7 @@ def run(
128
  ncols * image_size, 3)
129
  seeds = np.asarray(seeds).reshape(nrows, ncols)
130
 
131
- return len(image_indices), res, seeds
132
 
133
 
134
  def main():
@@ -239,6 +241,7 @@ def main():
239
  gr.outputs.Textbox(type='number', label='Number of Found Images'),
240
  gr.outputs.Image(type='numpy', label='Output'),
241
  gr.outputs.Dataframe(type='numpy', label='Seed'),
 
242
  ],
243
  title=TITLE,
244
  description=DESCRIPTION,
 
94
 
95
  tags = general_tags + hair_color_tags + hair_style_tags + \
96
  eye_color_tags + image_color_tags + other_tags + additional_tags
97
+ missing_tags = [tag for tag in tags if tag not in deepdanbooru_tag_dict]
98
+
99
  tag_indices = [
100
  deepdanbooru_tag_dict[tag] for tag in tags
101
  if tag in deepdanbooru_tag_dict
 
130
  ncols * image_size, 3)
131
  seeds = np.asarray(seeds).reshape(nrows, ncols)
132
 
133
+ return len(image_indices), res, seeds, ','.join(missing_tags)
134
 
135
 
136
  def main():
 
241
  gr.outputs.Textbox(type='number', label='Number of Found Images'),
242
  gr.outputs.Image(type='numpy', label='Output'),
243
  gr.outputs.Dataframe(type='numpy', label='Seed'),
244
+ gr.outputs.Textbox(type='str', label='Missing Tags'),
245
  ],
246
  title=TITLE,
247
  description=DESCRIPTION,