This is a simple pet project: a Telegram bot that allows users to seamlessly swap faces in their images. There are two types of swapping: using classical computer vision algorithms (like face meshing) based on facial landmarks obtained from the neural network, and the more accurate method using a pretrained model to swap faces from two given photos. Additionally, it can be deployed using Docker.
- This project uses two types of swapping (all model results can be found either in the original repositories or in the
/research/
folder). - Telegram integration for easy accessibility.
- User-friendly commands with inline image processing.
Follow these steps to set up the bot.
- Telegram API token (get yours at Telegram BotFather)
- Clone the repository:
git clone https://github.com/slava-qw/face-swap-tg-bot.git cd face-swap-tg-bot
- Write down your Telegram API token in the configuration file (
.env
). Also, for correct work, get the https-link to set up the webhook (e.g., https://localhost.run/docs/).
- Install dependencies:
pip install -r requirements.txt
- Run the code:
python main.py
- Build a Docker image and run a container:
docker-compose up