In our modern world where technology advances at an incredible pace, we often lose touch with the simple yet soulful things from the past. Who doesn't recall the scene from their childhood: the old Khrushchyovka buildings, the cozy courtyards, and, of course, the grandmother on the bench, watching over everyone and calling things the way they actually are. Times change, no more grandmas sitting next to the soulless apartment buildings, however thanks to the latest developments in artificial intelligence, we've found a way to recreate that atmosphere.
Neuro Granny is a Telegram bot that allows users to detect faces and misgender them in images.
To run Granny locally or on your own server, you will need the following:
- Python 3.10+
- Microsoft Visual C++ 14 Build tools
- Telegram bot token
- ONNX model file (train your own or follow this insightface guidline to get)
-
Clone the repository:
git clone https://github.com/Dimildizio/neuro_granny.git
-
Install dependencies:
Use poetry for that.
-
Set up your bot token: Create a bot on Telegram and obtain your API token.
-
Create a config.yaml file in the project directory and add your token and other necessary data. You can find an example of config.yaml here (All credits go to the
deepinsight
team) -
Go to the /predictor folder, put your onnx file there (default is inswapper_128.oonx) and run Fast API
cd src/predictor uvicorn model:app --reload
-
Run main.py to start the bot
Granny supports several commands that users can send in their Telegram chats to interact with the bot. Here are some common commands:
/start
: Start the bot.
One is supposed to send images with faces on it to Granny. Granny is deaf so she won't listen to anything you say and of course she is already too blind to read.
To classify faces in an image, simply send a photo to the bot. If the image contains faces, the bot will process it and return the image with (a) class(es) on it.
Here are some examples of face detection and misgendering:
Contributions to Granny are not welcome! It is a humorous project that is not going to be supported, however if you have ideas for improvements, bug reports, or feature requests, please open an issue.
This project is licensed under the MIT License.