NudeNet - automatic censoring AI software

Webteases are great, but what if you're in the mood for a slightly more immersive experience? Chat about Tease AI and other offline tease software.

Moderator: 1885

Bhurk
Explorer
Explorer
Posts: 14
Joined: Thu Mar 18, 2021 12:08 am

Re: NudeNet - automatic censoring AI software

Post by Bhurk »

willow11 wrote: Wed Apr 07, 2021 8:19 pm Well you threw me into a Rabbit hole with this.

I was a total beginner with python this morning.
  • 1. i wanted to go through a folder and censor all the images in it and put it out to another folder. Managed to do that
  • 2. Add an option to replace the black censor box with a gaussian blur. Done
  • 3. Add an option to replace the black censor box with a pixilation box. Done
Done with this for now. Now should i share this somewhere?
Can you post this somewhere like pastebin or something? Thanks.
User avatar
willow11
Explorer
Explorer
Posts: 13
Joined: Thu Nov 29, 2018 2:06 pm

Re: NudeNet - automatic censoring AI software

Post by willow11 »

sure np


the first one is the detector class i changed
https://pastebin.com/rkGP0JhD

it has a new argument now typec=blur or typec=pix for 1. gaussian blur or 2. pixilation.
You can also choose the intensity(?) of pixelation with the pixs=[8,8] argument. Standard is 8,8 but i feel like 16,16 gives the better result.


Here is my script that runs everything. I commented it. just add the input folder you want to censor and specify the output folder.
For now the output folder has to exist, the script wont create it. Also it is not recursive, so it wont work with subfolder etc. Just a folder with pix.

Here it is https://pastebin.com/CsfrmxBW

you can also change the ptb variable wich specifies what the censor function detects.
Let me know if you got any problems
User avatar
forbiddendesire
Explorer At Heart
Explorer At Heart
Posts: 598
Joined: Sun Aug 21, 2011 5:06 am
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: NudeNet - automatic censoring AI software

Post by forbiddendesire »

willow11 wrote: Sat Apr 10, 2021 7:55 am sure np


the first one is the detector class i changed
https://pastebin.com/rkGP0JhD

it has a new argument now typec=blur or typec=pix for 1. gaussian blur or 2. pixilation.
You can also choose the intensity(?) of pixelation with the pixs=[8,8] argument. Standard is 8,8 but i feel like 16,16 gives the better result.


Here is my script that runs everything. I commented it. just add the input folder you want to censor and specify the output folder.
For now the output folder has to exist, the script wont create it. Also it is not recursive, so it wont work with subfolder etc. Just a folder with pix.

Here it is https://pastebin.com/CsfrmxBW

you can also change the ptb variable wich specifies what the censor function detects.
Let me know if you got any problems
Thanks for sharing! I set it up and modified some of the ptb variables as needed, seems to run great! I love the pixelation so that's a great addition. Doesn't work so well with hentai pics, which is to be expected I suppose. Thanks again for sharing!
Image
Spoiler: show
Goddess Lisa Points: 125


Image
rotta
Explorer
Explorer
Posts: 31
Joined: Thu Oct 01, 2020 4:37 am

Re: NudeNet - automatic censoring AI software

Post by rotta »

willow11 wrote: Sat Apr 10, 2021 7:55 am

Here it is https://pastebin.com/CsfrmxBW

you can also change the ptb variable wich specifies what the censor function detects.
Let me know if you got any problems
I want to try this too. Getting this error:

TypeError: censor() got an unexpected keyword argument 'typec'

Never mind, I'm dumb. It obviously needs the modified detector. Thanks for sharing.
rotta
Explorer
Explorer
Posts: 31
Joined: Thu Oct 01, 2020 4:37 am

Re: NudeNet - automatic censoring AI software

Post by rotta »

willow11 wrote: Sat Apr 10, 2021 7:55 am sure np


the first one is the detector class i changed
https://pastebin.com/rkGP0JhD

it has a new argument now typec=blur or typec=pix for 1. gaussian blur or 2. pixilation.
You can also choose the intensity(?) of pixelation with the pixs=[8,8] argument. Standard is 8,8 but i feel like 16,16 gives the better result.


Here is my script that runs everything. I commented it. just add the input folder you want to censor and specify the output folder.
For now the output folder has to exist, the script wont create it. Also it is not recursive, so it wont work with subfolder etc. Just a folder with pix.

Here it is https://pastebin.com/CsfrmxBW

you can also change the ptb variable wich specifies what the censor function detects.
Let me know if you got any problems
Would it be a big effort to modify this to accept a folder with subfolders and then output everything in a different folder with the same folder structure? Also to ignore non image files instead of aborting the process on them.
LoserEmerald
Curious Newbie
Curious Newbie
Posts: 1
Joined: Mon May 03, 2021 8:23 pm

Re: NudeNet - automatic censoring AI software

Post by LoserEmerald »

Hey,

So this guy Vlad ported nudenet over to TFJS and NodeJS.
https://github.com/vladmandic/nudenet

And he says he got it working with TFJS in browser without issues.
https://github.com/notAI-tech/NudeNet/i ... -772043721

So I have been trying to get this to work, firstly at all and planning for browser but I don't know how to.


I'm currently stuck because I don't have the model and don't know how to get it, well sort of..

There is this line in the nudenet.js files main function.

Code: Select all

    log.info('  mkdir models/ mkdir models/saved; curl -L https://github.com/notAI-tech/NudeNet/releases/download/v0/detector_v2_default_checkpoint_tf.tar | tar -C models/saved -x');
But even the mkdir part is giving me syntax errors and the .tar is making me think he is on Linux.


So I have tried to download that and convert it like he shows on github.

Code: Select all

tensorflowjs_converter --input_format tf_saved_model --output_format tfjs_graph_model --strip_debug_ops=* --signature_name=predict --weight_shard_size_bytes=16777216 model-saved/ model-graph/
tensorflowjs_converter --input_format tf_saved_model --output_format tfjs_graph_model --strip_debug_ops=* --signature_name=predict --weight_shard_size_bytes=16777216 --quantize_float16=* ./model-saved ./model-graph-f16
But I can't get the converter to work, all I'm getting is this:
'tensorflowjs_converter' is not recognized as an internal or external command, operable program or batch file.


To be honest, I am probably doing something wrong since I have never worked with node or npm before.

Any help would be appreciated.

Some useful discussions:
https://github.com/notAI-tech/NudeNet/issues/20
https://github.com/notAI-tech/NudeNet/issues/54
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
Joined: Sun Jun 11, 2017 4:30 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: NudeNet - automatic censoring AI software

Post by GodDragon »

LoserEmerald wrote: Mon May 03, 2021 10:34 pm Hey,

So this guy Vlad ported nudenet over to TFJS and NodeJS.
https://github.com/vladmandic/nudenet

And he says he got it working with TFJS in browser without issues.
https://github.com/notAI-tech/NudeNet/i ... -772043721

So I have been trying to get this to work, firstly at all and planning for browser but I don't know how to.


I'm currently stuck because I don't have the model and don't know how to get it, well sort of..

There is this line in the nudenet.js files main function.

Code: Select all

    log.info('  mkdir models/ mkdir models/saved; curl -L https://github.com/notAI-tech/NudeNet/releases/download/v0/detector_v2_default_checkpoint_tf.tar | tar -C models/saved -x');
But even the mkdir part is giving me syntax errors and the .tar is making me think he is on Linux.


So I have tried to download that and convert it like he shows on github.

Code: Select all

tensorflowjs_converter --input_format tf_saved_model --output_format tfjs_graph_model --strip_debug_ops=* --signature_name=predict --weight_shard_size_bytes=16777216 model-saved/ model-graph/
tensorflowjs_converter --input_format tf_saved_model --output_format tfjs_graph_model --strip_debug_ops=* --signature_name=predict --weight_shard_size_bytes=16777216 --quantize_float16=* ./model-saved ./model-graph-f16
But I can't get the converter to work, all I'm getting is this:
'tensorflowjs_converter' is not recognized as an internal or external command, operable program or batch file.


To be honest, I am probably doing something wrong since I have never worked with node or npm before.

Any help would be appreciated.

Some useful discussions:
https://github.com/notAI-tech/NudeNet/issues/20
https://github.com/notAI-tech/NudeNet/issues/54
If you want a browser extension you could also write one that sends images to a local python web server (I am currently working on a python web server for a similar purpose) and just receives a result.
Kinda hacky and not marketable for like Chrome store but easily doable.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests