Zurück zum Ranking

pa7/nude.js

JavaScriptpatrick-wied.at/static/nudejs/

Nudity detection with JavaScript and HTMLCanvas

javascriptimage-processingimage-classificationnudity-detectionhtml5-canvas
Sterne-Wachstum
Sterne
2.4k
Forks
229
Wochenwachstum
Issues
20
1k2k
Jan. 2023März 2024Mai 2025Juli 2026
Artefaktenpmnpm install nude.js
README

nude.js

nude.js is a JavaScript implementation of a nudity scanner based on approaches from research papers. HTMLCanvas makes it possible to analyse image data and afterwards decide whether it should be displayed or not. The detection algorithm runs at the client, therefore it's possible (with user interaction) to display the image even if it's identified as nude (false positive) The real world usage for client side nudity detection could be in webproxies with child security filters, and maybe even more (e.g. on social media plattforms) nude.js is Open Source. Contributions are very welcome, the goal is to build a reliable client-side nudity scanner.

NOTE The algorithm is mostly based on the following paper: https://sites.google.com/a/dcs.upd.edu.ph/csp-proceedings/Home/pcsc-2005/AI4.pdf?attredirects=0

Demo

Test the nudity detection script on several predefined images, I didn't have enough time to build a nice demo with flickr image support but feel free to test some of your images too. nude.js is currently supported in IE9(excanvas), FF 3.6+, Chrome, Safari and Opera. For really fast results try Chrome.

Include nude.js as ususal

<script src="nude.js/compressed/nude.min.js"></script>

Add images as usual

<img src="sample1.jpg" alt="Alt text" id="image1" onclick="onImageClick('image1');" />
<img src="sample2.jpg" alt="Alt text" id="image2" onclick="onImageClick('image2');" />
<img src="sample3.jpg" alt="Alt text" id="image3" onclick="onImageClick('image3');" />

Then run the checking algorithm on the images you want to run it on

nude.js provides 3 functions:

nude.init()

The init function initializes nudejs by appending a hidden canvas element to the document’s body.

nude.load(param)

The load function sets the size of the invisible canvas element and draws the imagedata into the canvas. It uses 2 types of parameters: a valid id of an element in the document’s body or an image/video element (CAREFUL: make sure you define width and height of your element ).

nude.scan(function optional)

This function initiates the scanning process, the optional function is executed after the scanning process finished.

Example

nude.load(node);
// Scan it
nude.scan(function(result){ 
    alert(result ? "Nudity found in " + node.id + "!" : "Not nude");
});

Project page

https://www.patrick-wied.at/static/nudejs/

Contact

If you have any questions about the project, don't hesitate to contact me:

https://www.patrick-wied.at

contact@patrick-wied.at

Ähnliche Repositories
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenselearn-to-codenonprofits
contribute.freecodecamp.org
452.4k45.6k
practical-tutorials/project-based-learning

Curated list of project-based tutorials

PythonPyPIMIT Licensetutorialproject
274.6k35.4k
react/react

The library for web and native user interfaces.

JavaScriptnpmMIT Licensejavascriptreact
react.dev
246.7k51.3k
facebook/react

The library for web and native user interfaces.

JavaScriptnpmMIT Licensejavascriptreact
react.dev
233k47.8k
vuejs/vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

TypeScriptnpmMIT Licensevuejavascript
v2.vuejs.org
210.1k33.8k
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

JavaScriptnpmMIT Licensejavascriptalgorithms
196.3k31k
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

Otherbook-seriesjavascript
amazon.com/dp/B085XXCJ7X
184.6k33.5k
twbs/bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

MDXMIT Licensecssbootstrap
getbootstrap.com
174.5k78.7k
airbnb/javascript

JavaScript Style Guide

JavaScriptnpmMIT Licensejavascripteslint
148.1k26.6k
Chalarangelo/30-seconds-of-code

Coding articles to level up your development skills

JavaScriptnpmCreative Commons Attribution 4.0 Internationalawesome-listjavascript
30secondsofcode.org
128.5k12.5k
electron/electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

C++MIT Licenseelectronjavascript
electronjs.org
122.1k17.3k
nodejs/node

Node.js JavaScript runtime ✨🐢🚀✨

JavaScriptnpmOthernodejsjavascript
nodejs.org
118.4k36.2k