Skip to main content

NudeNet: Neural Nets for Nudity Classification, Detection and selective censoring

Classifier classes:

class name Description
safe Image is not sexually explicit
unsafe Image is sexually explicit

Detector classes:

class name Description
EXPOSED_ANUS Exposed Anus; Any gender
EXPOSED_ARMPITS Exposed Armpits; Any gender
COVERED_BELLY Provocative, but covered Belly; Any gender
EXPOSED_BELLY Exposed Belly; Any gender
COVERED_BUTTOCKS Provocative, but covered Buttocks; Any gender
EXPOSED_BUTTOCKS Exposed Buttocks; Any gender
FACE_F Female Face
FACE_M Male Face
COVERED_FEET Covered Feet; Any gender
EXPOSED_FEET Exposed Feet; Any gender
COVERED_BREAST_F Provocative, but covered Breast; Female
EXPOSED_BREAST_F Exposed Breast; Female
COVERED_GENITALIA_F Provocative, but covered Genitalia; Female
EXPOSED_GENITALIA_F Exposed Genitalia; Female
EXPOSED_BREAST_M Exposed Breast; Male
EXPOSED_GENITALIA_M Exposed Genitalia; Male

Usage

As Python module

Installation:

pip install --upgrade nudenetupdated

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}}

Detector Usage:

# Import module
from nudenet import NudeDetector

# initialize detector (downloads the checkpoint file automatically the first time)
detector = NudeDetector() # detector = NudeDetector('base') for the "base" version of detector.

# Detect single image
detector.detect('path_to_image')
# fast mode is ~3x faster compared to default mode with slightly lower accuracy.
detector.detect('path_to_image', mode='fast')
# Returns [{'box': LIST_OF_COORDINATES, 'score': PROBABILITY, 'label': LABEL}, ...]

Developpers

To get started, simply clone the repository and install the dependencies:

poetry install

Once the dependencies are installed, you can start developing your project.

Command Description
make test Run your unit tests
make lint Lint your code
make format Format your code
make mypy Run static type checking

Notes

Fork notes

  • The original project made by notAI-tech is here
  • The forked version made by platelminto taken for this project is here

Contributing

If you have any suggestions for improvements, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Metadata

Release files for NudeNetUpdated 2.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NudeNetUpdated 2.2.10
File Size Uploaded
nudenetupdated-2.2.10.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for NudeNetUpdated 2.2.10
File Interpreter ABI Platform
nudenetupdated-2.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / nudenetupdated-2.2.10.tar.gz

Download URL nudenetupdated-2.2.10.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
173844d2f18b1c6772d3dabacada1ea9cba34ffd545c2dd443f6abe4782f3791
BLAKE2b-256 checksum
How to use checksums
5124adc4d0d02b15c76a890dd22111d69c3a4ba0afa16ab17743d68c5d521800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.0 CPython/3.11.4 Windows/10

Release files / nudenetupdated-2.2.10-py3-none-any.whl

Download URL nudenetupdated-2.2.10-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf831f631cd11a15157dbe535d5cb2db1017959f8685e7570afac8cd1556e438
BLAKE2b-256 checksum
How to use checksums
95f779b18f47c89c751d7b88fbb86e646702f25931c98e94bfce457abdfee214
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.0 CPython/3.11.4 Windows/10

Release history Release notifications | RSS feed

This release

2.2.10 This release

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page