Practical overview
When it fits
Use it when a project needs image-level scores for the repository's five content categories and can incorporate those scores into its own review process.
Who it is for
- Python developers building image classification or content review workflows.
- Application developers evaluating the listed Keras, TensorFlow or TensorFlow.js model files.
- Teams that want category scores to help route images for review.
Documented uses
- Score one image against five documented content categories.
- Classify multiple images or a directory of images.
- Use image-category predictions as an input to an image review workflow.
Requirements & limits
- The prediction output contains scores for five named classes rather than a single documented safe/unsafe decision.
- The README points to requirements.txt for setup requirements but does not enumerate them in the excerpt.
- The reported 93% accuracy is stated for Inception V3 and should be considered in the context of that model and the repository's confusion matrix.
- The repository provides Keras, TensorFlow and TensorFlow.js model file options, with Inception v3 and MobileNet v2 variants.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Classify one image with the Python library
Load a Keras model file and request category scores for one image.
Before you start
- Python environment with the repository's requirements installed, as referenced by requirements.txt.
- A Keras model file, such as the documented MobileNet v2 224x224 file.
- An image file to classify.
Steps
Import predict from nsfw_detector.
Load the model file with predict.load_model(...).
Call predict.classify(model, 'image-file') to request the image's category scores.
Expected outcome
A result mapping the image to scores for drawings, hentai, neutral, porn and sexy.
Guide limitations
- Scores are model predictions and the repository does not document a complete moderation decision policy.
Classify images from the command line
Request predictions for one image or an image directory using the documented CLI syntax.
Before you start
- The package or command-line tool installed, as stated in the README.
- A saved model path and a local image file or image directory.
Steps
For a single image, run nsfw-predict with --saved_model_path and --image_source set to the model and image paths.
For a directory, use the same options and set --image_source to the directory path.
Expected outcome
The command-line classifier processes the specified image source and produces category predictions.
Guide limitations
- The README gives syntax examples but does not document installation steps or the exact output format for the CLI.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- GantMan/nsfw_model · Official homepage title · retained in its source language

