#python #nudity #api #detector #tensorflow #numpy #nuditydetector #pythonadultcontentdetector #adult #content #detector
AIOC : https://allinonecode.com/
Install : pip install --upgrade nudenet
#code
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}}
Classify video
batch_size is optional; defaults to 4
classifier.classify_video('path_to_video', batch_size=BATCH_SIZE)
Returns {"metadata": {"fps": FPS, "video_length": TOTAL_N_FRAMES, "video_path": 'path_to_video'},
"preds": {frame_i: {'safe': PROBABILITY, 'unsafe': PROBABILITY}, ....}}
Watch video How To Detect Nudity From Video or Image Using Python | Python Nudity Detector online, duration hours minute second in high quality that is uploaded to the channel AIOC all in one code 17 October 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 7,918 times and liked it 101 visitors.