Skip to content

Jochre3 Document Layout Analysis server including models for Blocks (text blocks and images), Text lines, Words and Glyphs

License

Notifications You must be signed in to change notification settings

joliciel-informatique/jochre3-dla-server

Repository files navigation

Jochre3 Document Layout Analysis Server

This server provides endpoints to detect:

  • Blocks (text blocks and images)
  • Text lines
  • Words
  • Glyphs

Each detection is independent - it's up to the client software to combine them.

Only block detection provides two different classes, "TopLevelTextBlock" and "Illustration".

Behind-the-scenes, all models were constructed using YOLOv8.

Running locally

If you haven't done so, create a pyenv environment.

Install pyenv

pyenv update
pyenv install 3.11.10
pyenv local 3.11.10
pyenv virtualenv jochre3-dla-server
pyenv activate jochre3-dla-server

To install all Python requirements:

pip install -r requirements.txt

To run locally:

python -m uvicorn app.main:app --host 0.0.0.0 --port 8444

Then navigate to:

http://localhost:8444/docs

Running as a docker image

docker build -t registry.gitlab.com/jochre/jochre3-dla-server:[YOUR-TAG] .
docker run --rm -it  -p 8444:8444/tcp registry.gitlab.com/jochre/jochre3-dla-server:[YOUR_TAG]

Then navigate to:

http://localhost:8444/docs

Working with the remote docker repository

Logging in

docker login registry.gitlab.com

Pulling an image and running it locally

After login, to download the docker image from the repository and run it locally:

docker pull registry.gitlab.com/jochre/jochre3-dla-server:[YOUR_TAG]
docker run --rm -it -p 8444:8444/tcp registry.gitlab.com/jochre/jochre3-dla-server:[YOUR_TAG]

Then navigate to:

http://localhost:8444/docs

Pushing a docker image

After login, to build the image and push it, run the commands below. If you don't enter a tag (below [YOUR_TAG], the tag latest is added automatically).

docker build -t registry.gitlab.com/jochre/jochre3-dla-server:[YOUR-TAG] .
docker push registry.gitlab.com/jochre/jochre3-dla-server:[YOUR-TAG]

About

Jochre3 Document Layout Analysis server including models for Blocks (text blocks and images), Text lines, Words and Glyphs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published