A lightweight nudity detection library for Python that provides deep learning-based classifiers for detecting nudity in images. As of version 3.4.2 (weights updated separately), the package supports labeling images as 'safe' or 'unsafe' and includes support for both CPU and GPU inference. The major v3 series introduced a new detector API and breaking import changes. Releases are intermittent with version bumps tied to model weights.
pip install nudenetVerified import paths — ran on the pinned version, not inferred.
Initialize the detector and classify an image. The detect method returns a list of detections with bounding boxes, scores, and labels.
Change import to `from nudenet import Detector`. The NudeDetector class was removed.
Use `detect()`. If you need simple safe/unsafe, call `detect()` and check if any detection has label starting with 'EXPOSED_'. The old classify returned {'safe': prob, 'unsafe': prob}.Manually download the weights from the GitHub releases (e.g., 'v3.4-weights') and place them in the default cache directory (~/.nudenet/) or set environment variable NUDENET_DIR.
Use a custom model if needed, or understand the label scope. The library has separate models for other categories but they are not default.
Specify the model path explicitly during Detector initialization: `Detector(model_path='path/to/model.onnx')`.
No dependency data recorded yet.