-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a NSFW protection #520
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm - thanks! We may want more classifiers in the future, and supporting that looks easy.
import { Mjolnir } from "../Mjolnir"; | ||
import * as nsfw from 'nsfwjs'; | ||
import {LogLevel} from "matrix-bot-sdk"; | ||
import { node } from '@tensorflow/tfjs-node'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will pull in over 285MB
of dependencies btw, which is more weight than the entire mjolnir docker image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image size isn't really a concern here, but if you're aware of alternatives, we can certainly consider them.
Adds a protection which utilizes https://github.com/infinitered/nsfwjs to determine if images sent into a protected room are NSFW. If so, mjolnir automatically redacts the image.
Also adds a config option to manually set the sensitivity of the protection.