infinitered/nsfwjs

NSFW detection on the client-side via TensorFlow.js

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 23 minutes ago
Added to GitGenius on September 7th, 2026
Created on February 13th, 2019
Open Issues & Pull Requests: 92 (+0)
GitHub issues: Enabled
Number of forks: 599
Total Stargazers: 8,976 (+0)
Total Subscribers: 92 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.1 days
Mean response time: 54.3 days
90th percentile: 71.2 days
Tracked items: 28

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 16
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 712 days
Stale 30+ days: 16
Stale 90+ days: 15

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • Extension Issues (1)
  • False Positives (1)
  • bug (1)
  • enhancement (1)
  • question (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

NSFWJS is a JavaScript library that performs client-side detection of adult content in images using TensorFlow.js. The library runs inference directly in the browser, classifying images into five categories: Drawing, Hentai, Neutral, Porn, and Sexy. It achieves approximately ninety percent accuracy with its smaller model and ninety-three percent with its midsized model.

The tool solves the problem of identifying inappropriate images without sending them to a server, preserving user privacy while filtering content. It uses pre-trained neural network models built on TensorFlow.js, allowing the classification to happen entirely on the client side. The library provides a simple API for loading a model, classifying images, and disposing of resources when done. It supports multiple backend options including WebAssembly and WebGPU for improved performance, and can also run in Node.js environments.

Developers should choose this tool when they need privacy-preserving content moderation in web applications, browser extensions, or Node.js services. It suits projects where sending images to external services is undesirable or impractical. The library offers selective model bundling through tree-shaking, allowing developers to include only the models they need to reduce bundle size. Three built-in models are available, with MobileNetV2 as the default. The tool supports various JavaScript environments including React Native and Browserify, and allows hosting custom models rather than relying on the default hosted versions.

The project maintains active engagement with its codebase through regular updates addressing infrastructure issues such as model hosting changes. Development activity shows responsiveness to user-facing problems, as evidenced by documentation updates guiding users to host their own models when necessary. The maintainers provide comprehensive examples across multiple environments and continue to refine the accuracy of the underlying models over time.