From 1591d2091c069e488a8fde0b3488a4d8148f1831 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Tue, 14 Jul 2026 16:22:47 +0200 Subject: [PATCH] update docs --- docs/ocrd.md | 4 ++-- docs/usage.md | 66 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/docs/ocrd.md b/docs/ocrd.md index 9e7e268..fc68a31 100644 --- a/docs/ocrd.md +++ b/docs/ocrd.md @@ -5,7 +5,7 @@ formally described in [`ocrd-tool.json`](https://github.com/qurator-spk/eynollah When using Eynollah in OCR-D, the source image file group with (preferably) RGB images should be used as input like this: - ocrd-eynollah-segment -I OCR-D-IMG -O OCR-D-SEG -P models eynollah_layout_v0_5_0 + ocrd-eynollah-segment -I OCR-D-IMG -O OCR-D-SEG -P models eynollah_layout_v0_9_0 If the input file group is PAGE-XML (from a previous OCR-D workflow step), Eynollah behaves as follows: - existing regions are kept and ignored (i.e. in effect they might overlap segments from Eynollah results) @@ -17,7 +17,7 @@ If the input file group is PAGE-XML (from a previous OCR-D workflow step), Eynol (because some other preprocessing step was in effect like `denoised`), then the output PAGE-XML will be based on that as new top-level (`@imageFilename`) - ocrd-eynollah-segment -I OCR-D-XYZ -O OCR-D-SEG -P models eynollah_layout_v0_5_0 + ocrd-eynollah-segment -I OCR-D-XYZ -O OCR-D-SEG -P models eynollah_layout_v0_9_0 In general, it makes more sense to add other workflow steps **after** Eynollah. diff --git a/docs/usage.md b/docs/usage.md index da164de..2f9a688 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -3,49 +3,69 @@ The command-line interface can be called like this: ```sh eynollah \ + [GENERIC_OPTIONS] \ + layout \ -i | -di \ -o \ - -m \ - [OPTIONS] + [LAYOUT_OPTIONS] ``` -## Processing options -The following options can be used to further configure the processing: +## Generic options +Pass any of the following options: -| option | description | +| **option** | **description** | +|---------------------------------------------------|:----------------------------------------------------------------| +| -m | override default directory `$PWD/models_eynollah` | +| -mv | override specific models, e.g. `region_1_2 '' /path/to/my.onnx` | +| -D | allocate models to GPUs, e.g. `col*:CPU,page:GPU1,*:GPU0` | +| -l | override default `INFO` log level e.g. `DEBUG` | + +## Processing options +The following options can be used to further control layout analysis: + +| **option** | **description** | |-------------------|:-------------------------------------------------------------------------------| -| `-fl` | full layout analysis including all steps and segmentation classes | -| `-light` | lighter and faster but simpler method for main region detection and deskewing | +| `-fl` | full layout analysis including all steps and segmentation classes (recommended)| | `-tab` | apply table detection | | `-ae` | apply enhancement (the resulting image is saved to the output directory) | | `-as` | apply scaling | -| `-cl` | apply contour detection for curved text lines instead of bounding boxes | +| `-cl` | apply contour detection for curved text lines, deskewing regions independently | | `-ib` | apply binarization (the resulting image is saved to the output directory) | | `-ep` | enable plotting (MUST always be used with `-sl`, `-sd`, `-sa`, `-si` or `-ae`) | -| `-eoi` | extract only images to output directory (other processing will not be done) | | `-ho` | ignore headers for reading order dectection | | `-si ` | save image regions detected to this directory | | `-sd ` | save deskewed image to this directory | | `-sl ` | save layout prediction as plot to this directory | | `-sp ` | save cropped page image to this directory | | `-sa ` | save all (plot, enhanced/binary image, layout) to this directory | +| `-thart` | confidence threshold of artifical boundary class during textline detection | +| `-tharl` | confidence threshold of artifical boundary class during region detection | +| `-ncu` | upper limit of columns in document image | +| `-ncl` | lower limit of columns in document image | +| `-slro` | skip layout detection and reading order | +| `-romb` | apply machine based reading order detection | +| `-ipe` | ignore page extraction | +| `-j` | number of CPU jobs to run parallel (useful with -di) | +| `-H` | when to halt if some jobs fail, e.g. `0.1` for 10% or `3` for 3 pages | If no option is set, the tool performs detection of main regions (background, text, images, separators and marginals). -### `--full-layout` vs `--no-full-layout` +### `--full-layout` vs shallow -Here are the difference in elements detected depending on the `--full-layout`/`--no-full-layout` command line flags: +Here are the differences in segment types detected: -| | `--full-layout` | `--no-full-layout` | -|--------------------------|-----------------|--------------------| -| reading order | x | x | -| header regions | x | - | -| text regions | x | x | -| text regions / text line | x | x | -| drop-capitals | x | - | -| marginals | x | x | -| marginals / text line | x | x | -| image region | x | x | +| | `-fl` | without | +|--------------------------|-------|---------| +| reading order | x | x | +| header regions | x | - | +| text regions | x | x | +| text regions / textlines | x | x | +| drop-capitals | x | - | +| marginals | x | x | +| marginals / textlines | x | x | +| image regions | x | x | + +(Note: No marginals are detected for pages with 3 columns or more.) ## Use as OCR-D processor Eynollah ships with a CLI interface to be used as [OCR-D](https://ocr-d.de) processor that is described in @@ -54,13 +74,13 @@ Eynollah ships with a CLI interface to be used as [OCR-D](https://ocr-d.de) proc The source image file group with (preferably) RGB images should be used as input for Eynollah like this: ``` -ocrd-eynollah-segment -I OCR-D-IMG -O SEG-LINE -P models +ocrd-eynollah-segment -I OCR-D-IMG -O SEG-LINE -P full_layout true ``` Any image referenced by `@imageFilename` in PAGE-XML is passed on directly to Eynollah as a processor, so that e.g. ``` -ocrd-eynollah-segment -I OCR-D-IMG-BIN -O SEG-LINE -P models +ocrd-eynollah-segment -I OCR-D-IMG-BIN -O SEG-LINE -P full_layout true ``` uses the original (RGB) image despite any binarization that may have occured in previous OCR-D processing steps.