mittagessen / kraken

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

Segment command with separate baseline and region models? #622

Closed fattynoparents closed 3 months ago

fattynoparents commented 4 months 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 4 months 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 4 months ago

Great, thanks a lot!

fattynoparents commented 3 months ago

Hi, any news on this?

mittagessen commented 3 months ago

Ah yeah, sorry. It works now.

fattynoparents commented 3 months 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