Skip to content
Snippets Groups Projects

Train

Use the teklia-dan train command to train a new DAN model.

Two subcommands are available depending on your dataset:

line
Train a DAN model at line-level and evaluate it.
document
Train a DAN model at document-level and evaluate it.

Examples

Document

To train DAN on documents:

  1. Set your training configuration in dan/ocr/document/train.py. Refer to the dedicated section for a description of parameters.
  2. Run teklia-dan train document.
  3. Look into evaluation results in the output folder:
    • checkpoints contains model weights for the last trained epoch and for the epoch giving the best valid CER.
    • results contains the tensorboard log file, the parameters file, and the evaluation results for the best epoch.

Line

To train DAN on lines:

  1. Set your training configuration in dan/ocr/line/train.py. Refer to the dedicated section for a description of parameters.
  2. Run teklia-dan train line.
  3. Look into evaluation results in the output folder:
    • checkpoints contains model weights for the last trained epoch and for the epoch giving the best valid CER.
    • results contains the tensorboard log file, the parameters file, and the evaluation results for the best epoch.

Note that it is possible to run teklia-dan train document to train DAN on text lines. However, the configuration must be updated when training on synthetic documents.

Additional page