Skip to content

wikimedia/mediawiki-services-open-nsfw

nsfwoid

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.

Running the service

Quick start

To run the service as a local Python process:

python3 app.py

Dockerization via Blubber

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.

API usage

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

About

Github mirror of "mediawiki/services/open-nsfw" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)

Resources

License

BSD-3-Clause, BSD-2-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE.txt
BSD-2-Clause
LICENSE-yahoo.txt

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages