Summary
NSFW JS is an open-source JavaScript library from Infinite Red that detects and categorises potentially inappropriate images directly in the user's browser, built on TensorFlow.js.
NSFW JS is an open-source JavaScript library from Infinite Red that detects and categorises potentially inappropriate images directly in the user's browser, built on TensorFlow.js.
Developers load the pre-trained model and call classify on any image, video or canvas element to get probability scores across five classes — Drawing, Hentai, Neutral, Porn and Sexy — with around 90% accuracy from the small model and around 93% from the midsized model, making it suitable for content moderation on sites with user-generated images.
Because all processing happens client-side, no images are sent to a server, which protects user privacy and reduces server load; it is free under the MIT licence, installable from npm, and ships with a live demo at nsfwjs.com.
Get more likes & reach the top of search results by adding this button on your site!


Get top updates in AI to your inbox every weekend. It's free!