Skip to content

Discord bot to extract text from image and translate it to English.

License

Notifications You must be signed in to change notification settings

farhannysf/ocr-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ocr-translate

Discord bot to extract text from image and translate it to English.

Build and Run Container with Docker Compose

The base image is using python38 DoD Hardened Container (DHC) from registry1.dso.mil/ironbank/opensource/python/python38:latest and requires U.S. Department of Defense Platform One credentials.

  1. Acquire your U.S. Department of Defense Platform One credentials. (More Info)
  2. Install Docker Compose on your machine. (More Info)
  3. Create Discord bots. You should create two instances of these bots for development and production builds. (More Info)
  4. Get Discord user ID of the bot maintainer. In Discord, Make sure you have Developer Mode enabled and then right click on maintainer Discord user -> Copy ID. (More Info)
  5. Create a file in this directory with the following format:
MAINTAINER_ID="YOUR-BOT-MAINTAINER-DISCORD-ID"
BOT_NAME="YOUR-BOT-NAME"
BOT_TOKEN="YOUR-DISCORD-BOT-TOKEN"
GOOGLE_VISION_KEY="YOUR-GOOGLE-VISION-API-KEY"

You should set different values for these keys on different build environment.

  1. Depending on the build environment, save the file as either dev.env for development build or prod.env for production build.
  2. Build and run container by invoking ./build dev for development build or ./build prod for production build. Container image will rebuild from scratch on each invocation intentionally.
  3. To see logs of running container, invoke docker logs -f ocr-translate-dev for development container or docker logs -f ocr-translate-prod for production container
  4. To shutdown running container, invoke ./shutdown dev for development container or ./shutdown prod for production container.

About

Discord bot to extract text from image and translate it to English.

Resources

License

Stars

Watchers

Forks