notAI-tech / NudeNet

Lightweight nudity detection
https://nudenet.notai.tech/
GNU Affero General Public License v3.0
1.81k stars 352 forks source link

Browser Integration / Extension #20

Open lolsatdanger opened 5 years ago

lolsatdanger commented 5 years ago

What is the possibility / feasibility of using this to create a browser extension? Namely being able to censor only certain things. Probably counter-intuitive to some, but this could have some applications for kinky people with a denial fetish, lol, such as only censoring one gender/parts.

I see something in the readme about in-browser detection, is that the same thing as this? Is that still a plan? Really unique work here and it'd be amazing.

bedapudi6788 commented 5 years ago

@lolsatdanger It is certainly possible and is relatively easy to get it running in-browser. This is certainly on my to-do list. Currently I am very stretched for time, but I will definitely add tensorflow js version of this when i get some time.

lolsatdanger commented 5 years ago

Awesome! I'm glad to hear that it is on your list. I was not familiar with tensorflow js, but looking up that github now, it seems great. I look forward to it when you have the time!

wingman-jr-addon commented 4 years ago

You might find my project to be helpful for providing a bit of the backbone: https://github.com/wingman-jr-addon/wingman_jr That one hooks image requests via filterResponseData, so it is Firefox only.

Or you might find the Purify.ai plugin to be a good starting base: https://github.com/purify-ai/geacc-crx

I think that a different use case for such a plugin would involve censoring only certain parts due to sensitivity and cultural norms - I don't think fetishes would have to be the only use case here.

nn12343456 commented 4 years ago

Hello,

I had a go at this myself using wingman-jr and tfjs-converter. I was able to replace the original model with NudeNet's model but I couldn't convert the detector model because it seems to use layers that aren't supported by tfjs (resnet?). Both classifier models have similar performance on my machine.

Side question: Would a browser extension be capable of running using multithreading?

That exhausts my understanding of ML. Maybe a tfjs version of the detector needs training from scratch?

bedapudi6788 commented 4 years ago

@nn12343456 I am currently working on a new version of the detector. I am planning to use https://github.com/faustomorales/retinanetjs as a starting point for the js version.

wingman-jr-addon commented 4 years ago

@nn12343456 Fascinating! Yes, I imagine you might run into layers not supported by TF.js. They are adding support for different layers relatively frequently, so definitely keep an eye on new versions. Regarding multi-threading, the answer is yes, but with some caveats. Generally speaking you use "web workers" to get processing in the background, and they act more similarly to processes with pipes than threads if you ask me. However, plugins using WebExtensions cannot use web workers (at least in the main background processing script), but might be able to in the content scripts. I'm curious - when you want do multithreading are you more looking at the GPU or CPU part of the workload? Perhaps @bedapudi6788 's approach using retinanetjs will already handle the threading concerns?

ddddddssssssssss commented 3 years ago

Im curious how did the project end ornhows going. There is no mention of brownser support afterwards, but the only use for NudeNet for me is to block stuff on brownsers

vladmandic commented 3 years ago

i have it working with tfjs in browser without issues. see issue #54 for discussion on the topic.