1
0
Fork
You've already forked NudeNetClassifier
0
A Neural Net for Nudity Detection. Classifier only.
  • Python 97.7%
  • Shell 2.3%
2023年09月30日 13:15:29 +00:00
.github Upload only sdist 2023年01月23日 12:44:44 +01:00
fastDeploy_recipes Keep only classifier 2023年01月23日 11:36:48 +01:00
nudenet nudenet/classifier.py aktualisiert 2023年09月30日 13:15:29 +00:00
.gitignore Keep only classifier 2023年01月23日 11:36:48 +01:00
LICENSE.md Create LICENSE.md 2022年11月01日 14:59:59 +05:30
README.md „README.md" ändern 2023年05月14日 12:58:00 +00:00
setup.py Remove useless imports 2023年01月23日 13:53:26 +01:00

Fork of https://github.com/platelminto/NudeNetClassifier

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

DOI Upload Python package

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 v2 from original is main here.

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: