Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsfwrecog_v1 censors too much #76

Open
MitPitt opened this issue Mar 5, 2024 · 5 comments
Open

nsfwrecog_v1 censors too much #76

MitPitt opened this issue Mar 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@MitPitt
Copy link

MitPitt commented Mar 5, 2024

Besides NSFW, it also detects face and covered parts of the body. Instead, it should be possible to choose which classes are to be censored.

@wkpark
Copy link
Owner

wkpark commented Mar 6, 2024

yes you can select specific obj classes
image

@wkpark wkpark self-assigned this Mar 6, 2024
@wkpark wkpark added the documentation Improvements or additions to documentation label Mar 6, 2024
@MitPitt
Copy link
Author

MitPitt commented Mar 7, 2024

I can't get classes to show up.
brave_3DH5CgjAur

@MitPitt
Copy link
Author

MitPitt commented Mar 7, 2024

When selecting this model I get WARNING ⚠️ Unable to automatically guess model task, assuming 'task=detect'. Explicitly define task for your model, i.e. 'task=detect', 'segment', 'classify','pose' or 'obb'.

@wkpark
Copy link
Owner

wkpark commented Mar 7, 2024

thank you for your reporting
I've just found very old mistake.

nsfwrecog_v1.onnx has bug. it has wrong classes information and it needs workaround to get the right classes information.

you can add the following json file in the models/yolo/ dir. make a new nsfwrecog_v1.json file in the dir. uddetailer will automatically load this json info to use it as classes info of the given model.

["EXPOSED ANUS",
"EXPOSED ARMPITS",
"COVERED BELLY",
"EXPOSED BELLY",
"COVERED BUTTOCKS",
"EXPOSED BUTTOCKS",
"FACE F",
"FACE M",
"COVERED FEET",
"EXPOSED FEET",
"COVERED BREAST F",
"EXPOSED BREAST F",
"COVERED GENITALIA F",
"EXPOSED GENITALIA F",
"EXPOSED BREAST M",
"EXPOSED GENITALIA M",
"EXPOSED BACK F",
"EXPOSED BACK M",
"DILDO"]

@wkpark wkpark added the bug Something isn't working label Mar 8, 2024
@jgrubs1
Copy link

jgrubs1 commented Mar 16, 2024

Another bug: neither nsfwrecog_v1 nor any other module that works with object classes will restore its configuration, even if it is saved using A1111's Setting > Other > Defaults > View changes > Apply sequence. This sequence saves changes to uddetailer's config into webui/ui-config.json. Most settings are restored, with the exception of object classes.

Here's what appears in the ui-config.json:

"txt2img/Object classes/value": [
   < here goes the correct list of objects >
],

However, after A1111 is restarted, these object classes are not loaded. Moreover, as MitPitt commented last week, object classes do not even appear next to the combo box. One has to select a different detection model, then re-select nsfwrecog_v1 to just make the selection box show up, and then re-select all the object classes.

Suggestion: display object classification list correctly after restart; load object classes on startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants