This is a fork of the open_nsfw-- project, updated for use in Wikimedia production. The project is originally based on Yahoo's open_nsfw.
It provides image NSFW likelihood scoring as a web service.
To run the service as a local Python process:
python3 app.py
Dockerfile generation and Docker image creation is supported with Wikimedia's Blubber tool. See the project documentation for details.
Note: Currently broken without patching Blubber; see https://phabricator.wikimedia.org/T227919.
The Blubber fork branch at https://github.com/mdholloway/blubber/tree/python-fix contains the commit adding the use-system-flag
declaration used in the Blubberfile here, cherry-picked on top of the latest Debian release.
POST the url
of an image to /v1/score
, and the service will fetch it and return the probability that it's NSFW, expressed as a floating point number between 0 and 1.
curl -d 'url=https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/263px-Wikipedia-logo-v2.svg.png' localhost:8080/v1/score 0.018645038828253746