Skip to content

sul-rds/text-spotting-as-a-service

Repository files navigation

Text-Spotting-as-a-Service

This repo is intended to support deployment of the Text-Spotting code from the MapReader project in a simple and convenient manner.

The deployment includes the following packages from the Maps as Data project:

Please see those repositories for more information.

At present there is a uv-based configuration and a Dockerfile which have been tested and confirmed to work for CUDA-enabled environments. There may be a simple web service added at some point, such that images can be POSTed to an API endpoint and JSON returned.

Installation

  1. Ensure the appropriate NVIDIA drivers for your system are installed.
  2. Clone the repository.

uv

  1. Ensure both uv and the NVIDIA CUDA Toolkit is installed (the config here expects CUDA >= 12)
  2. Run inference: uv run python spot-text.py /opt/maps/map.tiff

Docker

  1. Ensure both docker and the NVIDIA Container Toolkit are installed.

  2. Build the image:

    docker build -t text-spotting-as-a-service .

  3. Run inference: docker run --rm --gpus all -v /path/to/maps:/opt/maps text-spotting-as-a-service:latest uv run python spot-text.py /opt/maps/map.tiff

Usage

❯ uv run python spot-text.py --help

 Usage: spot-text.py [OPTIONS] IMAGE_PATH [OUTPUT_PATH] COMMAND [ARGS]...

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────╮
│ *    image_path       PATH           Path to the image [required]                         │
│      output_path      [OUTPUT_PATH]  Output path (defaults to stdout)                     │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────╮
│ --verbose  -v                                                                             │
│ --quiet    -q                                                                             │
│ --version                                                                                 │
│ --help               Show this message and exit.                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published