NSFW API MRF
Upstream MR: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3471
Hide, delete, or mark sensitive NSFW content with artificial intelligence.
Requires a NSFW API server, configured like so:
config :pleroma, Pleroma.Web.ActivityPub.MRF.NsfwMRF,
url: "http://127.0.0.1:5000/",
threshold: 0.8,
mark_sensitive: true,
unlist: false,
reject: false
The NSFW API server must implement an HTTP endpoint like this:
curl http://localhost:5000/?url=https://fedi.com/images/001.jpg
Returning a response like this:
{"score", 0.314}
Where a score is 0-1, with 1
being definitely NSFW.
A good API server is here: https://github.com/EugenCepoi/nsfw_api You can run it with Docker with a one-liner:
docker run -it -p 127.0.0.1:5000:5000/tcp --env PORT=5000 eugencepoi/nsfw_api:latest
Options:
-
url
: Base URL of the API server. Default: "http://127.0.0.1:5000/" -
threshold
: Lowest score to take action on. Default:0.7
-
mark_sensitive
: Mark sensitive all detected NSFW content? Default:true
-
unlist
: Unlist all detected NSFW content? Default:false
-
reject
: Reject all detected NSFW content (takes precedence)? Default:false
Edited by Alex Gleason