Update README.md
Browse files
README.md
CHANGED
|
@@ -84,3 +84,117 @@ const tags = scores
|
|
| 84 |
.map((score, i) => ({ tag: tagNames[i], score }))
|
| 85 |
.filter(x => x.score > 0.35)
|
| 86 |
.sort((a, b) => b.score - a.score);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
.map((score, i) => ({ tag: tagNames[i], score }))
|
| 85 |
.filter(x => x.score > 0.35)
|
| 86 |
.sort((a, b) => b.score - a.score);
|
| 87 |
+
|
| 88 |
+
// Affichage résultat
|
| 89 |
+
console.log("Tags détectés :", tags);
|
| 90 |
+
|
| 91 |
+
🔧 Prétraitement (Python)
|
| 92 |
+
|
| 93 |
+
def prepare_square_image(image, target_size=448):
|
| 94 |
+
canvas = Image.new("RGBA", image.size, (255, 255, 255))
|
| 95 |
+
canvas.alpha_composite(image.convert("RGBA"))
|
| 96 |
+
image = canvas.convert("RGB")
|
| 97 |
+
|
| 98 |
+
max_dim = max(image.size)
|
| 99 |
+
pad_left = (max_dim - image.size[0]) // 2
|
| 100 |
+
pad_top = (max_dim - image.size[1]) // 2
|
| 101 |
+
|
| 102 |
+
padded = Image.new("RGB", (max_dim, max_dim), (255, 255, 255))
|
| 103 |
+
padded.paste(image, (pad_left, pad_top))
|
| 104 |
+
|
| 105 |
+
if max_dim != target_size:
|
| 106 |
+
padded = padded.resize((target_size, target_size), Image.BICUBIC)
|
| 107 |
+
|
| 108 |
+
return padded
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
## 📊 Performance
|
| 112 |
+
|
| 113 |
+
| Élément | Valeur |
|
| 114 |
+
|--------|--------|
|
| 115 |
+
| Inférence navigateur | 3–5 s |
|
| 116 |
+
| Taille modèle | ~250 Mo |
|
| 117 |
+
| Tags totaux | 10 861 |
|
| 118 |
+
| Seuil recommandé | 0.35 |
|
| 119 |
+
|
| 120 |
+
---
|
| 121 |
+
|
| 122 |
+
## 📁 Fichiers fournis
|
| 123 |
+
|
| 124 |
+
- `model.onnx`
|
| 125 |
+
- `selected_tags.csv`
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## 🏷️ Catégories de tags
|
| 130 |
+
|
| 131 |
+
| Catégorie | Description | Exemples |
|
| 132 |
+
|----------|-------------|----------|
|
| 133 |
+
| Général | tags visuels | girl, solo |
|
| 134 |
+
| Artiste | noms d’artistes | … |
|
| 135 |
+
| Copyright | franchises | … |
|
| 136 |
+
| Personnage | noms de personnages | … |
|
| 137 |
+
| Meta | métadonnées | … |
|
| 138 |
+
| Classification | general, sensitive, explicit | … |
|
| 139 |
+
|
| 140 |
+
---
|
| 141 |
+
|
| 142 |
+
## 🎯 Cas d'usages
|
| 143 |
+
|
| 144 |
+
- Tagging automatique d'images
|
| 145 |
+
- Modération / filtrage
|
| 146 |
+
- SEO (métadonnées images)
|
| 147 |
+
- Annotation datasets ML
|
| 148 |
+
- Apps 100% navigateur (confidentialité)
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## ⚙️ Spécifications Techniques
|
| 153 |
+
|
| 154 |
+
- Entrée : `float32`, `[1, 448, 448, 3]`, **BGR**, 0–255
|
| 155 |
+
- Sortie : `float32`, `[1, 10861]`
|
| 156 |
+
- Activation : **sigmoid**
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
## 🙏 Crédits
|
| 161 |
+
|
| 162 |
+
- **Modèle original** : SmilingWolf
|
| 163 |
+
- **Dataset** : WaifuDiffusion v3
|
| 164 |
+
- **Conversion ONNX** : François MENGUY
|
| 165 |
+
|
| 166 |
+
---
|
| 167 |
+
|
| 168 |
+
## 📜 Licence
|
| 169 |
+
|
| 170 |
+
Licence **Apache 2.0**, autorise :
|
| 171 |
+
|
| 172 |
+
- Utilisation commerciale
|
| 173 |
+
- Modifications
|
| 174 |
+
- Distribution
|
| 175 |
+
- Usage privé
|
| 176 |
+
|
| 177 |
+
Veuillez créditer **SmilingWolf**.
|
| 178 |
+
|
| 179 |
+
---
|
| 180 |
+
|
| 181 |
+
## 🔗 Modèles Associés
|
| 182 |
+
|
| 183 |
+
- `wd-vit-tagger-v3`
|
| 184 |
+
- `wd-swinv2-tagger-v3`
|
| 185 |
+
- `wd-convnext-tagger-v3`
|
| 186 |
+
|
| 187 |
+
---
|
| 188 |
+
|
| 189 |
+
## 🛠️ Autres modèles par François MENGUY
|
| 190 |
+
|
| 191 |
+
- `Skarn55/gender-classification-onnx`
|
| 192 |
+
- https://fmenguy.fr/oai/
|
| 193 |
+
|
| 194 |
+
---
|
| 195 |
+
|
| 196 |
+
## 📧 Contact
|
| 197 |
+
|
| 198 |
+
Ouvrez une issue pour tout problème concernant cette version ONNX.
|
| 199 |
+
|
| 200 |
+
> Conversion ONNX réalisée avec ❤️ par François MENGUY.
|