Use Tesseract.js to automatically add notes (annotations) and existing Tags to your Szurubooru posts using extracted OCR text.
- Configuration via JSON or YAML
- Highly parallel fetching of posts/images and OCR processing
- User-defined OCR confidence level
- User-configurable behavior for handling notes/tags like "add only on none existing", "overwrite", and "add new"
- User-configurable search query
- Persistent ID tracking so this can be used to only update posts not already processed
Clone this repository somewhere and then install from the working directory
git clone https://github.com/FoxxMD/szurubooru-ocr .
cd szurubooru-ocr
nvm use # optional, to set correct Node version
npm install
npm build
foxxmd/szurubooru-ocr:latest
Or use the provided docker-compose.yml after modifying it to fit your configuration.
Recommended configuration steps for docker or docker-compose usage:
- If you must bind a host directory into the container for storing configurations and credentials:
- Using
-v
method for docker:-v /path/on/host/config:/config
- Using docker-compose:
- /path/on/host/config:/config
- Using
If you are
- using rootless containers with Podman
- running docker on MacOS or Windows
this DOES NOT apply to you.
If you are running Docker on a Linux Host you must specify user:group
permissions of the user who owns the configuration directory on the host to avoid docker file permission problems. These can be specified using the environmental variables PUID and PGID.
To get the UID and GID for the current user run these commands from a terminal:
id -u
-- prints UIDid -g
-- prints GID
You must have a valid, accessible configuration file in place in order to use this application.
- For Local installs simply rename
PROJECT_DIR/config/config.yaml.example
toPROJECT_DIR/config/config.yaml
- For Docker make sure you have bound a directory to the container directory
/config
. The example config will be copied there. Then do the same as the Local install.
See the Configuration README for config file explanation.
Application outputs logs to command line.
npm run start
Application outputs logs to docker logs.
docker run -e "PUID=1000" -e "PGID=1000" -v /path/on/host/config:/config foxxmd/szurubooru-ocr