Skip to content

A telegram bot providing neural style transfer service

License

Notifications You must be signed in to change notification settings

masim05/nst-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nst-telegram-bot

A telegram bot providing neural style transfer service.

Try it

https://t.me/YetAnotherOneNSTBot

Setup

Docker

git clone https://github.com/masim05/nst-telegram-bot.git
cd nst-telegram-bot
docker build -t nst-telegram-bot .
docker run -d -e TG_BOT_TOKEN=<YOUR_TOKEN> -e IMAGE_SIZE=256 -e EPOCHS=500 -e LR=0.005 -e ALPHA=10  -e BETA=60 nst-telegram-bot

Native, tested with python 3.11.4

git clone https://github.com/masim05/nst-telegram-bot.git
cd nst-telegram-bot
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
IMAGE_SIZE=64 EPOCHS=500 LR=0.005 ALPHA=10 BETA=60 TG_BOT_TOKEN=<YOUR_TOKEN> python app.py

Supported environment variables:

  • IMAGE_SIZE - size of the result image
  • EPOCHS - number of epochs to learn
  • LR - learning rate
  • ALPHA and BETA - weights of content_loss and style_loss respectively

Usage

Available commands:

  • /start - general greeting
  • /help - usage info
  • /debug - debug info

The bot expects to receive two images and sends result of NST in return. The first image will be used as a content image, the second - as a style one.

At the moment only one NST requests can be processes at a time due to hardware limitations of the hosting server. However, during NST other commands (eg, /debug) work.

Results

With parameters: IMAGE_SIZE=256, EPOCHS=500, LR=0.005, ALPHA=10.0, BETA=60.0

TODO

  • Share the code on github
  • Prepare README file
  • Implement the main flow
  • Dockerize
  • Deploy and run
  • Implement in non-blocking manner
  • Implement /transfer_style command
  • Re-train models

Credits

About

A telegram bot providing neural style transfer service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published