News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

Automated tagging

Started by neronero, Jun 19, 2023, 10:06 AM

Previous topic - Next topic

Raptor010

Overall, how is this automated tagging looking so far from y'all's experience? I imagine it probably does a decent job overall for the major tags, but how does it look with the more specific ones?

sneakysnicker

could you make an update on it? it worked for me some time ago but i deleted it from my computer at that time and when i try now, it just wont work anymore.
seems to me that the ui.py and settings_bk.json are just outdated but i'm not sure.

neroneroTopic starter

Looks like toriato's branch of the tagger extension is no longer being maintained. If toriato's version isn't working, you may need to switch to picobyte's branch of the extension:
https://github.com/picobyte/stable-diffusion-webui-wd14-tagger

New instructions:
1) Install Automatic1111's stable diffusion, the tagger extension, the latest version of BK tagging tool. Then download these modifications for BK's tagging tool:
Quote from: neronero on Jun 21, 2023, 12:24 PMModified files for BK's tagging tool
(Adds more "variants" to the tagging tool so that relevant booru tags are recognised)
settings.rpy and tagset_extended.rpy - replaces files in your BK tagger's game directory:
Picture_namer_for_BK-2.8-pc\game\...
2) Go to Automatic1111's Settings, Tagger, uncheck "Use spaces instead of underscore" and press apply settings.
3) Now open the Tagger extension's tab, set Weight threshold and Min tag fraction to 1.0 (for some reason this version of the tagger seems way more eager to add loads of tags?)
4) Under "Keep tag", add the following:
profile, card, quest, shop, full_body, portrait, upper_body, waitress, cooking, dancer, dancing, masseuse, massage, bath, geisha, etiquette, rest, sitting, lying, sleeping, naked, nude, service, sex, fuck, fucking, anal, anal sex, fetish, hardcore, lesbian, yuri, yaoi, bisexual, multiple_girls, bisexual_female, group, group_sex, multiple_boys, big, stallion, large_penis, huge_penis, stomach_bulge, beast, bestiality, machine, robot, monster, happy, laugh, neutral, sad, crying, cosplay, roleplay, role, maid, bunny, bunny_ears, swim, swimsuit, kimono, geisha, strip, stripping, undressing, sing, singing, fight, combat, battle, fighting, fighting_stance, libido, full-face_blush, erect_nipples, drunk, sensitivity, caress, headpat, hug, obedience, cleaning, broom, constitution, run, sport, exercise, public, outdoors, exhibitionism, crowd, onlookers, toy, sex_toy, object_insertion, dildo, dild, vibrator, vibr, beads, bead, anal_beads, plug, butt_plug, anal_tail, strap-on, strap, dirty, wet, oil, dom, femdom, sub, humiliation, humiliated, humiliate, insults, kiss, kissing, fondle, fondling, fondled, grabbing, grope, groped, groping, ass_grab, finger, masturbate, handjob, hj, penis worship, penis-worship, penis_worship, penisworship, titjob, paizuri, footjob, fj, oral, blowjob, bj, fellatio, deep, irru, dt, irrumaito, deepthroat, sixty-nine, 69, doggy, doggystyle, cowgirl, cowgirl_position, piledriver, upside-down, spooning, spoon, double, double_penetration, bondage, bdsm, restrained, tied_up_(sexual), gag, spanking, spank, spanked, slap_mark, rimming, anilingus, fisting, lactation, lactate, watersports, peeing, enema, cumshot, cum, on-body, cum_on_body, cum_on_breasts, on-face, facial, cum_on_face, in-hair, cum_on_hair, in-mouth, swallow, cum_in_mouth, inside, cum_in_ass, cum_in_pussy, internal_cumshot, creampie, cream, aftersex, after_sex, cumdrip, bukkake, cum-shower, cum shower, orgasm, denied, orgasm_denial, squirt, female_ejaculation, market, slave, cage, prison, tied_up_(nonsexual), advertise, cheerleader, holding_sign, spoken_blush, ceremony, nun, praying, own_hands_together, date, dating, couple, eating, party, 6+girls, 5girls, embar, embarrassed, angry, anger_vein, clenched_teeth, refuse, rape, molestation, hurt, injury, pain, sick, apron, china, cheongsam, chinese_clothes, dress, hooker, microskirt, pasties, revealing_clothes, miko, casual, student, school_uniform, teacher, formal, nurse, santa, christmas, bride, wedding_dress, catgirl, cat_ears, cat_girl, study, reading, classroom, writing, beach, nature, garden, forest, flower_field, grass, town, building, city, street, road, blindfold, collar, futanari, cunnilingus, tempt, seductive_smile, presenting, friend, virgin, defloration, pregnant, lingerie, libido, panties, tentacles, tentacle, uncen, uncensored, sprite, transparent_background, hq, lq, bad_anatomy, 1girl
5) Add a directory to the "Input directory" field, select an interrogator (I usually go with WD ViT v2) and press interrogate
6) If everything worked, you've now got text files text to those images. Use my rename program to rename the images using the generated text files.
7) Bring the renamed files to the tagging tool which should translate the booru-tags into BK-tags
My Girl Packs: [ link ] - Trait King mod: [ link ]

sjeongjin

#18
I've been trying to get autotagging to work for a couple weeks. I've gotten to the point where the tagging works but when I try to open up the tagging tool it crashes before changes can be made. I'm wondering two things, If the autotagging is supposed to be generous with tags because I'm getting alot more than expected even after adjusting the weight threshold and If the reason for the errors is from the name of the file being too long. If I could get this to work I could finally finish all the packs that i've been sitting on :/ I don't feel like manually tagging around 15k images just for like 7 packs

Spoiler

I'm sorry, but an uncaught exception occurred.

While loading <'ProportionalScale' <'Image' u'images/New folder (2)/1girl cheerleader panties cum sex cum_in_pussy cumdrip outdoors uncensored facial rape after_sex doggystyle cum_on_body grabbing school_uniform wet crying orgasm cum_on_breasts ful (1).jpg'> 1024 768 True>:
  File "game/script.rpy", line 1055, in script call
    call edit() from _call_edit
  File "game/script.rpy", line 1153, in script
    $ result = ui.interact()
  File "game/script.rpy", line 1153, in <module>
    $ result = ui.interact()
  File "game/script.rpy", line 251, in load
    child = im.cache.get(self.image)
IOError: Couldn't find file 'images/New folder (2)/1girl cheerleader panties cum sex cum_in_pussy cumdrip outdoors uncensored facial rape after_sex doggystyle cum_on_body grabbing school_uniform wet crying orgasm cum_on_breasts ful (1).jpg'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 1055, in script call
    call edit() from _call_edit
  File "game/script.rpy", line 1153, in script
    $ result = ui.interact()
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\ast.py", line 862, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\python.py", line 1912, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 1153, in <module>
    $ result = ui.interact()
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\core.py", line 2649, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\core.py", line 3132, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\core.py", line 2055, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 485, in renpy.display.render.render_screen
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\screen.py", line 669, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\layout.py", line 1117, in render
    st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "accelerator.pyx", line 108, in renpy.display.accelerator.transform_render
  File "render.pyx", line 233, in renpy.display.render.render
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\im.py", line 580, in render
    return cache.get(self, render=True)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\im.py", line 266, in get
    surf = image.load()
  File "game/script.rpy", line 251, in load
    child = im.cache.get(self.image)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\im.py", line 266, in get
    surf = image.load()
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\display\im.py", line 625, in load
    surf = renpy.display.pgrender.load_image(renpy.loader.load(self.filename), self.filename)
  File "C:\Users\sj\Desktop\Picture_namer_for_BK-2.8-pc\renpy\loader.py", line 555, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'images/New folder (2)/1girl cheerleader panties cum sex cum_in_pussy cumdrip outdoors uncensored facial rape after_sex doggystyle cum_on_body grabbing school_uniform wet crying orgasm cum_on_breasts ful (1).jpg'.

Windows-8-6.2.9200
Ren'Py 7.0.0.196
Picture namer for BK 2.8.14
Sun Jun 02 02:04:50 2024
[close]
If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin

neroneroTopic starter

I remember changing some settings to make Windows accept longer filenames, but I don't know if it'll work for your version of Windows.
My Girl Packs: [ link ] - Trait King mod: [ link ]

sjeongjin

So here's what I found with your advice. Windows Explorer doesnt support longer file names even now and can only read them. Even with longer filepaths enabled There's no current way to get windows explorer to read them and so the problem seems to be if the autotagger adds like 40 tags windows explorer will only read and record up to its file length limit and then shorten the name.


The Solution I found that removed the error is just putting the BK namer at the start of the C: drive which shortened the file path just enough to make it readable. The problem I expect to see is that because the filename limit still exists There's no way to fix any file name that somehow manages to still go beyond the character limit.

The two solutions that might fix this would either be to make the autotagger more accurate which might work (and would be nice timesaving wise) but is pretty limited due to some images just having a ton of tags to begin with or the other solution which is to download a file explorer that actually enables longer file paths. I did some searching and although most file explorers are paid subscription services these days I found a free 2017 version that seemed to work. I don't know how to add files directly to posts so anyone with the same problem will just have to go to the site. https://www.xyplorer.com/free.php

The problem I foresee but don't know if it exists yet is that I'm unsure how the autotagger and by extension your rename program works. Because i'm not too well versed in the code side i'm unsure if when the autotagger writes the file names if windows explorer will automatically shorten it since xyplorer isn't the default file explorer. i'm also unsure if changing my default file explorer will solve this issue if it exists and if your python program will have the same issue ( which I don't think it should?). For now i think i'll test changing the default file explorer and see what the results are.

If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin

sjeongjin

#21
ERROR: C:/Users/sj/Desktop/New folder (2)\1girl sex cowgirl_position panties nude profile cum sitting cum_in_pussy lying uncensored full-face_blush rape embarrassed cheerleader undressing bad_anatomy outdoors school_unifor.txt: Text file contents do not fit in filename, some tags may have been discarded

So as i expected filename seems to still be capped when using the rename via txt program. I'm unsure how to fix it. It looks like the program renames files through windows explorer?
If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin

Goldo

I think we should take a step back: there isn't much value for the game's behavior to add overtly descriptive tagging. If you are running over ten tags, that's definitely too much and in almost all cases will not make any meaningful difference to the game's algorithms compared to a handful of well-chosen tags. It's apparent in your example file name that only 5 or 6 tags will be relevant to BK there.

So if you wanted to add a whole genAI prompt-like tagging scheme, it would definitely be better to put it somewhere else than in the file's name, as there are obvious limitations to that solution including the 256-character Windows path limit.

Probably use a buffer that is handled in the app itself or in a json somewhere, and the renaming should only focus on such tags that are relevant to the game and/or validated by a human.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

sjeongjin

Just trying to figure out a way to make this work while reducing the tagging workload in any way possible and also trying to follow the initial instructions as well as possible so there's no user error since I'm not too well versed in the ai prompt side of things. I'm currently sitting on 11.4k images in my update folder alone... I don't know if I would have enough time in a week to even finish a pack manually anymore without losing my mind because of how many images I'm sitting on so any way to make this work would be a plus for me.
If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin

neroneroTopic starter

Quote from: Goldo on Jun 06, 2024, 03:58 PMIt's apparent in your example file name that only 5 or 6 tags will be relevant to BK there.
Well, not exactly. The list of tags that the tool keeps is specifically curated to align with tags available in BK's tagging tool. Some of the terminology is different, more wordy or only tangentially related. (eg: the gelbooru tag bad_anatomy will be interpreted by the tagging tool as the BK tag freq_low)

@sjeongjin Is Weight threshold and Min tag fraction set to 1.0 already? If those are set lower then the AI will start adding tags with low confidence.
I could always modify the file renaming tool to automatically chop off characters if there are too many. But I personally think the best solution is to make the list of "Keep tag"s smaller as you see fit. Those are all the tags that the AI is allowed to add to the filename. Currently they include booru-versions of every eligible Brothel King tag, plus all extended tags. But extended tags aren't used by the game much so you could easily lop those off. "Technical tags" such as uncensored ("uncen" in BK) and transparent_background ("sprite" in BK) can also easily be trimmed out.
My Girl Packs: [ link ] - Trait King mod: [ link ]

sjeongjin

@neronero I tried to follow your instructions to a T so both Weight threshold and Min tag fraction were set to 1.0. Most likely cutting extended tags is the most efficient way to solve the issue since I usually cut some of them when manually tagging so Ill try that next. Just wanted to wait for a reply to see if anything could be done on the technical side of things since the only problem/restriction with file path is because of windows explorer and there are other file explorers that have no problems with the file path limit.
If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin

Goldo

Quote from: sjeongjin on Jun 09, 2024, 06:11 PM@neronero I tried to follow your instructions to a T so both Weight threshold and Min tag fraction were set to 1.0. Most likely cutting extended tags is the most efficient way to solve the issue since I usually cut some of them when manually tagging so Ill try that next. Just wanted to wait for a reply to see if anything could be done on the technical side of things since the only problem/restriction with file path is because of windows explorer and there are other file explorers that have no problems with the file path limit.

Not really an answer but IIRC the character limit in Windows explorer is on the path name, not just the file name, so putting your image folder lower in the folder hierarchy may free some characters for you.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

sjeongjin

#27
Quote from: sjeongjin on Jun 06, 2024, 09:09 AMThe Solution I found that removed the error is just putting the BK namer at the start of the C: drive which shortened the file path just enough to make it readable. The problem I expect to see is that because the filename limit still exists There's no way to fix any file name that somehow manages to still go beyond the character limit.
That's what I've been doing to fix the initial error I got which made the bk naming tool unable to read the image files.

It's a temporary fix but i've also been trying others things like Reading The picobyte github page which gave me the idea of switching interrogate models from ViT to ConvtNext since the idea is that ConvtNext uses more resources and is slower but should have higher tagging accuracy. It seemed to work when i tested tagging individual pictures with the highest confidence rate tag being added around 97% with all others discarded but for some reason when I tested tagging in bulk the accuracy kinda got nuked again.

 A few tags in particular seem to have problems such as the uncensored tag, any environmental tag such as outdoors/grass/etc, and tags that involve multiple people.

tags with multiple people in particular causes all sorts of problems where it sometimes can't tell the difference between male and female so sometimes it gets tagged 5girls+ when they're all guys 1girl and you  sometimes see random yaoi tags and futa tags.

the nude tag should also be manually added for this game because of how the game automatically assumes sexual tags as nude and how that  interacts with the game.

I've never been too sure about the double penetration tag in game but the tagging tool says to only tag anal or vag sex as double penetration whereas the autotagger will count oral which personally i think should be the case but i guess it might have a text interaction i dont know about? and there are all sorts of minor accuracy problems that add up but for those i think you just gotta deal with it and accept that its still a net time saved gain and I would 100% rather remove an excess of tags from a picture than have to add them.

anyways I cant do much about the character limit itself but I've still been testing the tagger out to see how I can get it more accurate results. Hopefully I can get to the point where Its good enough that i can focus on finishing packs instead of tinkering with the autotagger lol.

edit: images with windows also sometimes get tagged as cages
 
If a link doesn't exist it's because its been updated. You can see if your pack is up to date by checking the most recent upload date.
https://www.mediafire.com/folder/ucepgm8smsnuu/BK_girl_packs
If you want to help me buy higher quality images for packs donate here.
https://ko-fi.com/sjeongjin