How To Detect Nudity From Video or Image Using Python | Python Nudity Detector

Publié le: 17 octobre 2021
sur la chaîne: AIOC all in one code
7,918
101

#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}, ....}}


Sur cette page du site, vous pouvez voir la vidéo en ligne How To Detect Nudity From Video or Image Using Python | Python Nudity Detector durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur AIOC all in one code 17 octobre 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 7,918 fois et il a aimé 101 téléspectateurs. Bon visionnage!