Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
GNU General Public License v3.0
1.05k stars 209 forks source link

Implement --non_existing_pred_handling_mode in Evaluator #289

Closed fstrunz closed 1 year ago

fstrunz commented 3 years ago

The --non_existing_file_handling_mode in the eval script was not implemented. This PR moves the parameter to EvaluatorParams so that it can be directly accessed from evaluate, and renames it to --non_existing_pred_handling_mode as the evaluator is not concerned with files.

I would have expected that the parameter now becomes --evaluator.non_existing_pred_handling_mode or at least --gt.*, but Calamari now expects simply --non_existing_pred_handling_mode. I am unsure how to fix this, which is why I will keep this PR as a draft for now.

Nevertheless, this new parameter is now implemented and supports skip, error and empty.

bertsky commented 1 year ago

This fixes #322, so I'd be happy if this could go forward.

(I don't feel I can contribute anything to the discussion how to name the options. --non_existing_pred_handling_mode skip --gt.non_existing_as_empty false seems fine with me, or at least not more confusing than --non_existing_file_handling_mode skip --evaluator.non_existing_pred_as_empty false ...)