🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

NudeNetUpdated

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

NudeNetUpdated

2.2.10
PyPI
Maintainers
1

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

Classifier classes:

class nameDescription
safeImage is not sexually explicit
unsafeImage is sexually explicit

Detector classes:

class nameDescription
EXPOSED_ANUSExposed Anus; Any gender
EXPOSED_ARMPITSExposed Armpits; Any gender
COVERED_BELLYProvocative, but covered Belly; Any gender
EXPOSED_BELLYExposed Belly; Any gender
COVERED_BUTTOCKSProvocative, but covered Buttocks; Any gender
EXPOSED_BUTTOCKSExposed Buttocks; Any gender
FACE_FFemale Face
FACE_MMale Face
COVERED_FEETCovered Feet; Any gender
EXPOSED_FEETExposed Feet; Any gender
COVERED_BREAST_FProvocative, but covered Breast; Female
EXPOSED_BREAST_FExposed Breast; Female
COVERED_GENITALIA_FProvocative, but covered Genitalia; Female
EXPOSED_GENITALIA_FExposed Genitalia; Female
EXPOSED_BREAST_MExposed Breast; Male
EXPOSED_GENITALIA_MExposed 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.

CommandDescription
make testRun your unit tests
make lintLint your code
make formatFormat your code
make mypyRun static type checking

Notes

  • 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

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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts