This repository contains an implementation of Yahoo's Open NSFW Classifier rewritten in Keras.
The original caffe weights have been extracted using Caffe to TensorFlow. You can find them at data/open_nsfw-weights.npy
.
This works for both Images and Videos.
All code should be compatible with Python 3.6
and Keras
. The model implementation can be found in model.py
.
> python keras_open_nsfw.py test.jpg
Results for 'test.jpg'
SFW score: 0.9355766177177429
NSFW score: 0.06442338228225708
> python keras_open_nsfw_video.py video.mp4
Results for 'video.mp4'
Contain NSFW
NSFW % = 57.89473684210527