mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
708 stars 129 forks source link

Segment command with separate baseline and region models? #622

Closed fattynoparents closed 1 month ago

fattynoparents commented 1 month ago

I have trained two segmentation models separately (with --suppress-regions and --suppress-baselines parameters correspondingly), because it seems to give me more robust results than when I train one model for both purposes.

In eScriptorium it's possible to first segment a bunch of images with one model (f.ex.region), then run the Segment command again with the baseline model.

Is it possible to achive this in kraken? If so, how to use the kraken segment command to include both baseline and region models?

If this is not possible, which parameters can be adjusted in ketos segtrain command to improve the training process?

mittagessen commented 1 month ago

The API already supports it but apparently I forgot to adapt the CLI interface to allow multiple segmentation models. I'll add it later today.

fattynoparents commented 1 month ago

Great, thanks a lot!

fattynoparents commented 1 month ago

Hi, any news on this?

mittagessen commented 1 month ago

Ah yeah, sorry. It works now.

fattynoparents commented 1 month ago

Thanks, as of dev version 5.2.9 I can now successfully run segmentation with this command:

kraken -d cuda:0 -x -I '/path/to/images/*.jpg' -o '.xml' segment -bl --model /path/to/baseline-only.mlmodel --model /path/to/region-only.mlmodel