LegereOCR
Copyright 2026 Cristian Camilo Robledo Cuellar

Licensed under the Apache License, Version 2.0 (see LICENSE).

This product includes third-party code and resources:

- legereocr/tablas/conciliacion.py: ported and adapted from PaddleX
  (https://github.com/PaddlePaddle/PaddleX), Apache License 2.0,
  Copyright (c) 2024 PaddlePaddle Authors.

- legereocr/motores/deteccion.py (box scoring, vertex ordering, unclip distance and the binarise / contour /
  minimum-rectangle flow of the DB post-processing) and legereocr/motores/reconocimiento.py (perspective crop of a
  text box): adapted from PaddleOCR / PaddleX (https://github.com/PaddlePaddle/PaddleOCR,
  https://github.com/PaddlePaddle/PaddleX; `DBPostProcess` and `get_rotate_crop_image`), Apache License 2.0,
  Copyright (c) PaddlePaddle Authors. Changes: rewritten for numpy and OpenCV without pyclipper (the unclip offset
  is computed on the minimum-area rectangle), with additional filters, a rescue step and tiling of large pages.

- legereocr/tablas/tableformer.py and scripts/exportar_tableformer_onnx.py: port
  logic from docling-ibm-models (https://github.com/docling-project/docling-ibm-models),
  MIT License, Copyright (c) 2024 International Business Machines.
  License text: licencias/MIT-docling-ibm-models.txt.

- legereocr/formulas/formulanet.py: the byte-to-unicode table of the GPT-2 byte-level BPE
  (https://github.com/openai/gpt-2), MIT License, Copyright (c) OpenAI.
  License text: licencias/MIT-GPT2.txt.

- legereocr/recursos/pdf.ttf: GlyphLessFont from the Tesseract OCR project
  (https://github.com/tesseract-ocr/tesseract), Apache License 2.0.
  Provenance: legereocr/recursos/LEEME.txt.

- legereocr/recursos/sRGB.icc: sRGB2014 profile, Copyright International Color
  Consortium, 2015. Distributed unmodified under the ICC terms
  (legereocr/recursos/LEEME-sRGB.txt).

- legereocr/salidas/_afm_times.py: glyph widths from the Adobe Core 14 AFM metrics
  (Times), Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated, taken from
  the files distributed with matplotlib. Notice and terms: licencias/Adobe-AFM.txt.

- benchmark/restauracion/docres_torch.py: rewrites functions of inference.py from
  DocRes (https://github.com/ZZZHANG-jx/DocRes), MIT License.
  License text: licencias/MIT-DocRes.txt.

- benchmark/idiomas/textos.json: excerpts of the Universal Declaration of Human Rights in
  88 languages, taken from https://github.com/unicode-org/udhr (see LICENSES.md, section 1).

Image preprocessing and post-processing steps replicate the documented behaviour of
PaddleOCR / PaddleX and RapidOCR (both Apache License 2.0) so that the same models give the
same results. Their licenses are compatible with this project's.

The recognition models and the fonts are NOT part of the package: they are downloaded at run
time from their official sources and keep their authors' licenses. See LICENSES.md.
