NudeNet: Neural Nets for Nudity Classification, Detection and selective censoring
Fork differences:
- Only the default classifier is available.
- The classifier no longer throws the
Initializer block1_conv1_bn/keras_learning_phase:0 appears in graph inputs and will not be treated as constant value/weight. etc.warning. - It only works on images.
- The classifier is included in the project itself.
- Only the v2 model is available (the original repo's default). So
v2from original ismainhere.
Uncensored version of the following image can be found at https://i.imgur.com/rga6845.jpg (NSFW)
Classifier classes:
| class name | Description |
|---|---|
| safe | Image is not sexually explicit |
| unsafe | Image is sexually explicit |
As self-hostable API service
# Classifier
docker run -it -p8080:8080 notaitech/nudenet:classifier
# See fastDeploy-file_client.py for running predictions via fastDeploy's REST endpoints
wget https://raw.githubusercontent.com/notAI-tech/fastDeploy/master/cli/fastDeploy-file_client.py
# Single input
python fastDeploy-file_client.py --file PATH_TO_YOUR_IMAGE
# Client side batching
python fastDeploy-file_client.py --dir PATH_TO_FOLDER --ext jpg
Note: golang example https://github.com/notAI-tech/NudeNet/issues/63#issuecomment-729555360, thanks to Preetham Kamidi
As Python module
Installation:
pip install -U git+https://github.com/platelminto/NudeNet
Classifier Usage:
# Import module
from nudenet import NudeClassifier
# initialize classifier (downloads the checkpoint file automatically the first time)
classifier = NudeClassifier()
# Classify single image
classifier.classify('path_to_image_1')
# Returns {'path_to_image_1': {'safe': PROBABILITY, 'unsafe': PROBABILITY}}
# Classify multiple images (batch prediction)
# batch_size is optional; defaults to 4
classifier.classify(['path_to_image_1', 'path_to_image_2'], batch_size=BATCH_SIZE)
# Returns {'path_to_image_1': {'safe': PROBABILITY, 'unsafe': PROBABILITY},
# 'path_to_image_2': {'safe': PROBABILITY, 'unsafe': PROBABILITY}}
Notes:
- The current version of NudeDetector is trained on 160,000 entirely auto-labelled (using classification heat maps and various other hybrid techniques) images.
- The entire data for the classifier is available at https://archive.org/details/NudeNet_classifier_dataset_v1
- A part of the auto-labelled data (Images are from the classifier dataset above) used to train the base Detector is available at https://github.com/notAI-tech/NudeNet/releases/download/v0/DETECTOR_AUTO_GENERATED_DATA.zip
Metadata
Release files for NudeNetClassifier 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| NudeNetClassifier-2.1.1.tar.gz | 77.2 MB | Without provenance | Details for NudeNetClassifier-2.1.1.tar.gz |
Release files / NudeNetClassifier-2.1.1.tar.gz
| Download URL | NudeNetClassifier-2.1.1.tar.gz |
|---|---|
| Size | 77.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6299ed295b46cc2af6620a5e335c26155b87856e0f5e36de374e6c64117be52f
|
|
BLAKE2b-256 checksum How to use checksums |
542f9b500741f7116050f49b0c8cc4390230063f58219cf0f2882c3cfa07791c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for NudeNetClassifier 2.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.