Skarn55 commited on
Commit
29e7e4f
·
verified ·
1 Parent(s): 7d52236

Upload 2 files

Browse files
Files changed (2) hide show
  1. convert.py +16 -0
  2. tags.json +0 -0
convert.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import csv
2
+ import json
3
+
4
+ # Télécharge selected_tags.csv depuis https://huggingface.co/SmilingWolf/wd-v1-4-vit-tagger-v2/resolve/main/selected_tags.csv
5
+ with open('selected_tags.csv', 'r', encoding='utf-8') as f:
6
+ reader = csv.DictReader(f)
7
+ tags = []
8
+ for row in reader:
9
+ if row['category'] == '0': # General tags only
10
+ tags.append(row['name'])
11
+
12
+ with open('tags.json', 'w', encoding='utf-8') as f:
13
+ json.dump(tags, f, ensure_ascii=False)
14
+
15
+ print(f"General tags only : {len(tags)} tags")
16
+ print("Exemples : ", tags[:10])
tags.json ADDED
The diff for this file is too large to render. See raw diff