awoo
Browse filesSigned-off-by: Balazs Horvath <[email protected]>
README.md
CHANGED
@@ -263,8 +263,6 @@ This will put a link to the JSON next to the download button on e621.net and e6a
|
|
263 |
|
264 |
### [eva02-vit-large-448-8046](https://huggingface.co/Thouph/eva02-vit-large-448-8046)
|
265 |
|
266 |
-
|
267 |
-
|
268 |
The following inference script for the tagger needs a folder as input, be warned that it also converts WebP images to PNG and you can specify tags to be ignored and some other stuff! I recommend reading through it and changing whatever you need.
|
269 |
|
270 |
<div style="background-color: lightyellow; padding: 10px;">
|
@@ -392,6 +390,14 @@ for image_filename in image_files:
|
|
392 |
and allowed_tags[indices[i]] not in ("placeholder0", "placeholder1")
|
393 |
]
|
394 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
# Escape unescaped parentheses in the tags
|
396 |
tags_to_write_escaped = [
|
397 |
re.sub(r"(?<!\\)(\()", r"\\\1", tag) for tag in tags_to_write
|
|
|
263 |
|
264 |
### [eva02-vit-large-448-8046](https://huggingface.co/Thouph/eva02-vit-large-448-8046)
|
265 |
|
|
|
|
|
266 |
The following inference script for the tagger needs a folder as input, be warned that it also converts WebP images to PNG and you can specify tags to be ignored and some other stuff! I recommend reading through it and changing whatever you need.
|
267 |
|
268 |
<div style="background-color: lightyellow; padding: 10px;">
|
|
|
390 |
and allowed_tags[indices[i]] not in ("placeholder0", "placeholder1")
|
391 |
]
|
392 |
|
393 |
+
# Replace 'safe', 'explicit', and 'questionable' with their 'rating_' counterparts
|
394 |
+
tags_to_write = [
|
395 |
+
tag.replace("safe", "rating_safe")
|
396 |
+
.replace("explicit", "rating_explicit")
|
397 |
+
.replace("questionable", "rating_questionable")
|
398 |
+
for tag in tags_to_write
|
399 |
+
]
|
400 |
+
|
401 |
# Escape unescaped parentheses in the tags
|
402 |
tags_to_write_escaped = [
|
403 |
re.sub(r"(?<!\\)(\()", r"\\\1", tag) for tag in tags_to_write
|