lquirosd/P2PaLA

TextLine region

mrocr opened this issue · 4 comments

mrocr commented

@lquirosd

Currently, I am trying to train p2pala to recognize the "TextLine" regions not baselines.
How exactly can I do that, how can I select the default TextLine region itself

An example page-xml is attached along with my training config txt file.
sample.zip

Waiting for your reply

Hi, P2PaLA is developed to avoid that kind of cumbersome process. TextLine polygons most of the time are very time demanding to sketch for handwritten text documents (printed documents are easier but not always). In P2PaLA you can train the model for baselines and use the --line_offset argument to define height of the TextLine, then the system will automatically extract a TextLine around each baseline.

For example, on the sample.zip PAGE-XML file you can see the results using the example model and default parameters (--line_offset 50) for your sample page.

mrocr commented

.

Hi,
There you have two main options:

  1. Write short script to create a baseline given the TextLine polygon (for printed documents something simple like the poly-line defined by the bottom vertexes of the TextLine-polygon plus some pixels on the Y-axis should work).
  2. Update imgprocess.py and xmlPAGE.py scripts to create the GT mask using the TextLine node instead of Baseline.

Best Regards,

mrocr commented

@lquirosd hmmmm...

  1. A script that would create baselines from textlines page-xml is great. You will upload such script so that I test.

  2. I tried this option, but instead of modifying imgprocess.py and xmlPAGE.py I just copied the TextLine regions and renamed into Baseline, download sample.zip, and trained using this config.zip the p2pala detection results were not good. I either get no results, or the results are bad.