Can you post this somewhere like pastebin or something? Thanks.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
Done with this for now. Now should i share this somewhere?
- 3. Add an option to replace the black censor box with a pixilation box. Done
NudeNet - automatic censoring AI software
Moderator: 1885
Re: NudeNet - automatic censoring AI software
Re: NudeNet - automatic censoring AI software
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
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
- forbiddendesire
- 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
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!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
- Spoiler: show
Re: NudeNet - automatic censoring AI software
I want to try this too. Getting this error: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
TypeError: censor() got an unexpected keyword argument 'typec'
Never mind, I'm dumb. It obviously needs the modified detector. Thanks for sharing.
Re: NudeNet - automatic censoring AI software
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.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
-
- Curious Newbie
- Posts: 1
- Joined: Mon May 03, 2021 8:23 pm
Re: NudeNet - automatic censoring AI software
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.
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.
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
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');
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
'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
-
- 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
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.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.But even the mkdir part is giving me syntax errors and the .tar is making me think he is on Linux.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');
So I have tried to download that and convert it like he shows on github.But I can't get the converter to work, all I'm getting is this: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
'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
Kinda hacky and not marketable for like Chrome store but easily doable.
Who is online
Users browsing this forum: No registered users and 15 guests