Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
Apache License 2.0
1.04k stars 209 forks source link

the .cls().create_trainer() method in the "train.py" #288

Open Tailor2019 opened 2 years ago

Tailor2019 commented 2 years ago

Hello! @ChWick @andbue Please where can I retrieve the implementation of this method? and what design the "cls()" in the source code ? Is the create_trainer() defines parameters for training before or after preprocessing the data? Thanks a lot for your continuous help!

andbue commented 2 years ago

createtrainer is defined here: https://github.com/Planet-AI-GmbH/tfaip/blob/516a1f176e979c0abeb305550be0682c25a059e3/tfaip/scenario/scenariobase.py#L290 it calls the __init_\ of the trainer class defined in the scenario, in our case https://github.com/Calamari-OCR/calamari/blob/5068248289fc05458ee6eadf921d025afafb97a7/calamari_ocr/ocr/scenario.py#L27-L30 this means it calls this function: https://github.com/Calamari-OCR/calamari/blob/d12c93827b119033b63c8301dc4a40c723b81bd1/calamari_ocr/ocr/training/trainer.py#L35 Everything until there just defines parameters. The setup of the pipelines and the training starts only with the train()-function https://github.com/Calamari-OCR/calamari/blob/d12c93827b119033b63c8301dc4a40c723b81bd1/calamari_ocr/ocr/training/trainer.py#L70

Tailor2019 commented 2 years ago

@ChWick @andbue Thanks for your fast reply! Please can you tell about some explanation about the setup of the pipelines. thanks a lot!

andbue commented 2 years ago

Sorry, you do have to be a bit more specific here.

Tailor2019 commented 2 years ago

@andbue I mean the preprocessing and post processing pipelines. How can I monitor these pipeline (which parameters can I use) Does the definition of parameters occurs after or before launching the setup of the pipelines to run? Thanks in advance!