Skip to main content

An ensemble of Neural Nets for Nudity Detection and Censoring

Project description

NudeNet: An ensemble of Neural Nets for Nudity Detection and Censoring

Pre-trained models available at

Uncensored version of the following image can be found at (NSFW)

Classification Classes

nude -> image contains nudity

safe -> image doesn't contain nudity

Detection Classes

BELLY -> exposed belly (both male and female)

BUTTOCKS -> exposed buttocks (both male and female)

F_BREAST -> exposed female breast

F_GENITALIA -> exposed female genitalia

M_GENETALIA -> exposed male genetalia

M_BREAST -> exposed male breast


pip install nudenet
pip install git+

Classifier Usage

from nudenet import NudeClassifier
classifier = NudeClassifier('classifier_checkpoint_path')
# {'path_to_nude_image': {'safe': 5.8822202e-08, 'nude': 1.0}}

Detector Usage

from nudenet import NudeDetector
detector = NudeDetector('detector_checkpoint_path')

# Performing detection
# [{'box': [352, 688, 550, 858], 'score': 0.9603578, 'label': 'BELLY'}, {'box': [507, 896, 586, 1055], 'score': 0.94103414, 'label': 'F_GENITALIA'}, {'box': [221, 467, 552, 650], 'score': 0.8011624, 'label': 'F_BREAST'}, {'box': [359, 464, 543, 626], 'score': 0.6324697, 'label': 'F_BREAST'}]

# Censoring an image
detector.censor('path_to_nude_image', out_path='censored_image_path', visualize=False)

#To Do:

  1. Improve Documentation for the functions. (Right now user has to see the function definition to understand all the params)
  2. Convert these models into tflite, tfjs and create another repo that used tfjs to perform in browser detection and censor.

Note: Entire credit for collecting the object recognition dataset goes to (NSFW). The link for their api and the discord are as follows API here: Discord:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for NudeNet, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size NudeNet-1.0.4.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View
Filename, size NudeNet-1.0.4-py2.py3-none-any.whl (17.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page