Page 2 of 2

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Wed Apr 21, 2021 11:38 pm
by sblatt
rotta wrote: Tue Apr 20, 2021 4:52 pm Thanks for sharing, I tried it for Domme Tags and it works great.

One issue I noticed was that it's a bit trigger happy to tag boobs even if there's a slightest glimpse visible from the side. Maybe the closeup code could be in reverse somehow?

I'll try some local tags next.
Update:
- you can define min_X_size (in % of picture, so 0 to 100; face, boobs, ass, pussy, feet, cock) to remove small objects. As I don't know a sane value its set to 0, but feel free to change that. setting it to the min_closeup_size_X would only add it when its a closeup
- also added feet to closeup-tags
- added min_closeup_size_X, so you can set the closeup size for the body parts indivitually. I set some values that I think might fit, but feel free to change

If you want to retag you need to set resume to False !

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Fri Apr 23, 2021 9:32 am
by rotta
Thanks for the update, I think it works a lot better when you can opt for filtering out smaller boxes. Still tinkering with the settings.

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Thu Sep 14, 2023 7:07 pm
by sblatt
It looks like there is some new nudenet application that i don't know, and the original is now called nudenetupdated. The rest stays the same. I will update the scripts,

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Wed Sep 27, 2023 7:53 am
by GoudDeal
Hello there ! I'm having an issue, the script cannot identify any of the image somehow. All the images are jpg if that helps and they are divided in subfolders (like domme main folder -> subfolder 1 -> pic1-2-3 / subfolder 2-> pic 1-2-3... Etc).

Could it be because there are spaces in the path for the images ? if not do you have an idea of what could be causing this problem ?

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Fri Sep 29, 2023 3:02 pm
by sblatt
Can you post the command and output?

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Fri Sep 29, 2023 4:37 pm
by GoudDeal
sblatt wrote: Fri Sep 29, 2023 3:02 pm Can you post the command and output?

Code: Select all

E:\Private\Milovana>python AutoTagger.py -d "E:\Private\Katya Clover"
********
(1/45) Starting dir E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018
********
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0001.jpg
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0002.jpg
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0003.jpg
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0004.jpg
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0005.jpg
Error: cannot identify image file: E:\Private\Katya Clover\10331q_Clover_Oliane - 08-09-2018\MetArt_Oliane_Mango-A_high_0006.jpg
...
I didn't put the whole output because as you can guess it goes for all the image in the directory and there are quite a lot but here it is.

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Fri Sep 29, 2023 5:16 pm
by GoudDeal
sblatt wrote: Fri Sep 29, 2023 3:02 pm Can you post the command and output?
I figured it out (glad I know a bit of python), it appears to be an issue from the Onnxruntime the detector is using. It requires to provide "Providers" (whatever this is) to works

Here is the error code I had when debugging.

Code: Select all

ValueError("This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)")
I fixed it by changing the line 362 in the file "onnx_inference_collection.py" from

Code: Select all

providers: Sequence[str | tuple[str, dict[Any, Any]]] | None = None,
to

Code: Select all

providers: Sequence[str | tuple[str, dict[Any, Any]]] | providers = ['AzureExecutionProvider', 'CPUExecutionProvider'],
I am not sure if this is something you can fix directly from your script since it seems to be from the package itself but at least now it works for me and it may be a solution if other people have this issue.

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Sun Oct 01, 2023 6:14 pm
by sblatt
Happy this worked for you.
I used the python 3.11 from the windows store and did not have this issue.

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Mon Jan 01, 2024 11:59 am
by Tarzi
I had trouble getting this to work so I made some changes, maybe someone will find it useful.
ImageImage
drop the script into the folder with DommeName (Test on .gif) and click 2x on script will check the Test folder and subfolders

Script:

Code: Select all

# pip install --upgrade nudenet
# pip install Pillow

import os
import shutil
from nudenet import NudeDetector
from PIL import Image

min_face_size = 0
min_breast_size = 1
min_ass_size = 1
min_pussy_size = 0
min_feet_size = 1

min_closeup_size_face = 30
min_closeup_size_breasts = 30
min_closeup_size_pussy = 5
min_closeup_size_ass = 40
min_closeup_size_feet = 20

dressings = ["TagFullyDressed", "TagHalfDressed", "TagGarmentCovering", "TagHandsCovering", "TagSeeThrough", "TagNaked"]

def main():
    folder = os.getcwd()

    if not os.path.isdir(folder):
        print("ERROR: Current directory not found")
        exit(1)

    tagsfile = os.path.join(folder, "ImageTags.txt")
    if os.path.isfile(tagsfile):
        backup_file = tagsfile + "-beforeNudeDetector"
        if not os.path.isfile(backup_file):
            shutil.copyfile(tagsfile, backup_file)

    tagsdata = get_tags_data(tagsfile)
    do_folder(folder, tagsdata)

def write_tags(tags_file, tagsdata):
    with open(tags_file, "w") as tf:
        for t in tagsdata:
            tf.write(t + " " + " ".join(tagsdata[t]) + "\n")

def get_tags_data(tagsfile):
    tagsdata = {}
    tagsinfile = None
    if os.path.isfile(tagsfile):
        with open(tagsfile, "r") as f:
            for line in f:
                if len(line.split(" ")) < 2:
                    continue
                filename = line.split(" ")[0].lower()
                tags = line.split(" ")[1:]
                tagsf = []
                for t in tags:
                    if t.strip() != "":
                        tagsf.append(t.strip())
                tagsdata.update({filename: tagsf})
    return tagsdata

def do_folder(folder, parent_tagsdata):
    subfolders = [f.path for f in os.scandir(folder) if f.is_dir()]

    images = [f.name for f in os.scandir(folder) if f.is_file() and f.name.lower().endswith(('.png', '.jpg', '.jpeg', '.gif'))]
    if images:
        detector = NudeDetector()
        imgcounter = 0

        tagsfile = os.path.join(folder, "ImageTags.txt")
        log_file = os.path.join(folder, "log.txt")

        tagsdata = get_tags_data(tagsfile)

        with open(log_file, "w") as log:
            for img in images:
                imgcounter += 1
                imgfile = os.path.join(folder, img)

                try:
                    image = Image.open(imgfile)
                    width, height = image.size
                    size = (width * height) / 100
                    detected = detector.detect(imgfile)
                    image.close()

                except Exception as e:
                    if img != "ImageTags.txt" and img != "ImageTags.txt-beforeNudeDetector":
                        print(f"Error: cannot identify image file: {imgfile}. Error: {e}")
                    continue

                covered = 0
                exposed = 0
                detected_tags = set()
                breast_size = 0
                face_size = 0
                ass_size = 0
                feet_size = 0
                pussy_size = 0

                for d in detected:
                    if d['class'] == 'FACE_FEMALE':
                        face_size += d['box'][2] * d['box'][3]
                        if (face_size / size) > min_face_size:
                            detected_tags.add("TagFace")

                    if d['class'] == 'FEMALE_BREAST_COVERED':
                        breast_size += d['box'][2] * d['box'][3]
                        if (breast_size / size) > min_breast_size:
                            detected_tags.add("TagBoobs")
                            covered += 1

                    if d['class'] == 'FEMALE_BREAST_EXPOSED':
                        breast_size += d['box'][2] * d['box'][3]
                        if (breast_size / size) > min_breast_size:
                            detected_tags.add("TagBoobs")
                            exposed += 1

                    if d['class'] == 'FEMALE_GENITALIA_COVERED':
                        pussy_size += d['box'][2] * d['box'][3]
                        if (pussy_size / size) > min_pussy_size:
                            detected_tags.add("TagPussy")
                            covered += 1

                    if d['class'] == 'FEMALE_GENITALIA_EXPOSED':
                        pussy_size += d['box'][2] * d['box'][3]
                        if (pussy_size / size) > min_pussy_size:
                            detected_tags.add("TagPussy")
                            exposed += 1

                    if d['class'] == 'BUTTOCKS_COVERED':
                        ass_size += d['box'][2] * d['box'][3]
                        if (ass_size / size) > min_ass_size:
                            detected_tags.add("TagAss")
                            covered += 1

                    if d['class'] == 'BUTTOCKS_EXPOSED':
                        ass_size += d['box'][2] * d['box'][3]
                        if (ass_size / size) > min_ass_size:
                            detected_tags.add("TagAss")
                            exposed += 1

                    if d['class'] == 'ANUS_EXPOSED':
                        detected_tags.add("TagAss")
                        exposed += 1

                    if d['class'] == 'FEET_EXPOSED':
                        feet_size += d['box'][2] * d['box'][3]
                        if (feet_size / size) > min_feet_size:
                            detected_tags.add("TagFeet")
                            exposed += 1

                if (face_size / size) > min_closeup_size_face:
                    detected_tags.add("TagCloseUp")
                if (breast_size / size) > min_closeup_size_breasts:
                    detected_tags.add("TagCloseUp")
                if (ass_size / size) > min_closeup_size_ass:
                    detected_tags.add("TagCloseUp")
                if (pussy_size / size) > min_closeup_size_pussy:
                    detected_tags.add("TagCloseUp")
                if (feet_size / size) > min_closeup_size_feet:
                    detected_tags.add("TagCloseUp")

                log.write(f"{img}\n")
                log.write(f"{detected}\n")
                log.write(f"covered: {covered}\n")
                log.write(f"exposed: {exposed}\n")
                log.write(f"breast_size: {round(breast_size / size, 1)}%\n")
                log.write(f"face_size: {round(face_size / size, 1)}%\n")
                log.write(f"ass_size: {round(ass_size / size, 1)}%\n")
                log.write(f"feet_size: {round(feet_size / size, 1)}%\n")
                log.write(f"pussy_size: {round(pussy_size / size, 1)}%\n")

                if img in tagsdata:
                    if not any(elem in tagsdata[img] for elem in dressings):
                        if exposed > 0:
                            if covered > 0:
                                detected_tags.add("TagHalfDressed")
                            else:
                                detected_tags.add("TagNaked")
                        else:
                            if covered > 0:
                                detected_tags.add("TagFullyDressed")
                    olddata = set(tagsdata[img])
                    for tag in detected_tags:
                        olddata.add(tag)
                    if len(olddata) > 0:
                        tagsdata.update({img: list(olddata)})
                    else:
                        del tagsdata[img]
                else:
                    if exposed > 0:
                        if covered > 0:
                            detected_tags.add("TagHalfDressed")
                        else:
                            detected_tags.add("TagNaked")
                    else:
                        if covered > 0:
                            detected_tags.add("TagFullyDressed")
                    if len(detected_tags) > 0:
                        tagsdata.update({img: detected_tags})

                if img in tagsdata:
                    print("(" + str(imgcounter) + "/" + str(len(images)) + ") " + " ".join([img] + list(tagsdata[img])))
                else:
                    print("(" + str(imgcounter) + "/" + str(len(images)) + ") " + img + " no tags found, removing tag line")

            current_folder_tagsfile = os.path.join(folder, "ImageTags.txt")
            write_tags(current_folder_tagsfile, tagsdata)

    for subfolder in subfolders:
        subfolder_tagsdata = dict(parent_tagsdata)
        do_folder(subfolder, subfolder_tagsdata)

if __name__ == "__main__":
    main()
output:

Code: Select all

ImageTags.txt:

0004.jpg TagFullyDressed TagFace TagBoobs
0025.jpg TagFace
0046.jpg TagPussy TagFullyDressed TagFace TagBoobs
0137.jpg TagPussy TagBoobs TagFace TagNaked
0175.jpg TagPussy TagBoobs TagFace TagNaked

-------------------------------------------------------------------------------------------

log.txt:

0004.jpg
[{'class': 'FACE_FEMALE', 'score': 0.8451889753341675, 'box': [677, 465, 278, 261]}, {'class': 'FEMALE_BREAST_COVERED', 'score': 0.6339001655578613, 'box': [869, 979, 288, 305]}, {'class': 'FEMALE_BREAST_COVERED', 'score': 0.5970433354377747, 'box': [584, 1010, 276, 304]}]
covered: 2
exposed: 0
breast_size: 4.1%
face_size: 1.7%
ass_size: 0.0%
feet_size: 0.0%
pussy_size: 0.0%
0025.jpg
[{'class': 'FACE_FEMALE', 'score': 0.7126649618148804, 'box': [190, 890, 216, 185]}, {'class': 'FEET_COVERED', 'score': 0.698259711265564, 'box': [362, 2014, 221, 320]}, {'class': 'FEET_COVERED', 'score': 0.6864796876907349, 'box': [1349, 1958, 228, 340]}]
covered: 0
exposed: 0
breast_size: 0.0%
face_size: 1.0%
ass_size: 0.0%
feet_size: 0.0%
pussy_size: 0.0%
0046.jpg
[{'class': 'FACE_FEMALE', 'score': 0.8106878399848938, 'box': [676, 203, 187, 171]}, {'class': 'BELLY_EXPOSED', 'score': 0.7625148892402649, 'box': [666, 763, 289, 271]}, {'class': 'FEMALE_BREAST_COVERED', 'score': 0.7466608285903931, 'box': [636, 546, 201, 196]}, {'class': 'FEMALE_BREAST_COVERED', 'score': 0.740764856338501, 'box': [827, 542, 217, 196]}, {'class': 'FEET_COVERED', 'score': 0.6916413903236389, 'box': [850, 2024, 208, 371]}, {'class': 'FEMALE_GENITALIA_COVERED', 'score': 0.6599462032318115, 'box': [693, 1091, 166, 152]}, {'class': 'FEET_COVERED', 'score': 0.6093620657920837, 'box': [710, 2086, 178, 324]}]
covered: 2
exposed: 0
breast_size: 2.0%
face_size: 0.8%
ass_size: 0.0%
feet_size: 0.0%
pussy_size: 0.6%
0137.jpg
[{'class': 'FACE_FEMALE', 'score': 0.8321080207824707, 'box': [587, 515, 301, 286]}, {'class': 'BELLY_EXPOSED', 'score': 0.7961225509643555, 'box': [535, 1407, 405, 403]}, {'class': 'FEMALE_BREAST_EXPOSED', 'score': 0.7858959436416626, 'box': [802, 1024, 312, 287]}, {'class': 'FEMALE_BREAST_EXPOSED', 'score': 0.7823674082756042, 'box': [504, 1046, 283, 292]}, {'class': 'FEMALE_GENITALIA_EXPOSED', 'score': 0.6504278182983398, 'box': [528, 1977, 225, 216]}]
covered: 0
exposed: 3
breast_size: 4.1%
face_size: 2.1%
ass_size: 0.0%
feet_size: 0.0%
pussy_size: 1.2%
0175.jpg
[{'class': 'FACE_FEMALE', 'score': 0.804704487323761, 'box': [1236, 269, 207, 208]}, {'class': 'FEMALE_BREAST_EXPOSED', 'score': 0.7938959002494812, 'box': [1442, 715, 215, 191]}, {'class': 'FEMALE_BREAST_EXPOSED', 'score': 0.7776776552200317, 'box': [1204, 711, 221, 226]}, {'class': 'FEMALE_GENITALIA_EXPOSED', 'score': 0.7422179579734802, 'box': [1380, 1251, 156, 187]}, {'class': 'BELLY_EXPOSED', 'score': 0.7043899297714233, 'box': [1293, 946, 319, 240]}, {'class': 'ARMPITS_EXPOSED', 'score': 0.2738102078437805, 'box': [1585, 577, 107, 172]}]
covered: 0
exposed: 2
breast_size: 2.2%
face_size: 1.0%
ass_size: 0.0%
feet_size: 0.0%
pussy_size: 0.7%
python --version
--Python 3.11.4
pip --version
--pip 23.3.2
pip show Pillow
--Name: Pillow
--Version: 10.1.0
pip show nudenet
--Name: nudenet
--Version: 3.0.8

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Wed Mar 13, 2024 10:47 pm
by Skirata
Tarzi wrote: Mon Jan 01, 2024 11:59 am python --version
--Python 3.11.4
pip --version
--pip 23.3.2
pip show Pillow
--Name: Pillow
--Version: 10.1.0
pip show nudenet
--Name: nudenet
--Version: 3.0.8
I'm trying to get this to work and am running into trouble.

python --version
--Python 3.11.8
pip --version
--pip 24.0
pip show Pillow
--Name: Pillow
--Version: 10.2.0
pip show nudenet
--name: nudenet
--version: 3.0.8

When I try to run it, all that happens is a command prompt briefly opens, and then subsequently closes. I get no generated text file, and I'm not sure what I'm doing wrong.
I haven't been able to get things running the way the original post states either, but I'm not accustomed to using python anyways, so I'm guessing it's 100% an issue on my end.

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Mon Mar 18, 2024 9:41 pm
by Tarzi
Skirata wrote: Wed Mar 13, 2024 10:47 pm
When I try to run it, all that happens is a command prompt briefly opens, and then subsequently closes. I get no generated text file, and I'm not sure what I'm doing wrong.
I haven't been able to get things running the way the original post states either, but I'm not accustomed to using python anyways, so I'm guessing it's 100% an issue on my end.
Go to:
C:\Users\UserName\.NudeNet\
download classifier_lite.onnx and classifier_model.onnx from: https://github.com/notAI-tech/NudeNet/releases/tag/v0
When it still doesn't work maybe replace the rest of the files in the folder.

Open script via prompt: python scriptName.py
then you will see an error in the console.

Just checked and it works for me:
Image

Re: NudeNet - Automatic Tagging software for TeaseAI

Posted: Thu Mar 28, 2024 9:06 pm
by SkyLigth
When I run it I get the following error:

Code: Select all

[E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running Concat node. Name:'anchors/concat' Status Message: concat.cc:157 onnxruntime::ConcatBase::PrepareForCompute Non concat axis dimensions must match: Axis 0 has mismatched dimensions of 1 and 75

Code: Select all

[E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running Concat node. Name:'anchors/concat' Status Message: concat.cc:157 onnxruntime::ConcatBase::PrepareForCompute Non concat axis dimensions must match: Axis 0 has mismatched dimensions of 1 and 50
anyone can help what might be the cause of it.