Doc-UFCN Integration: PageXML Transformation and Scaling Questions

Hi everyone,

I’m working on integrating Doc-UFCN into my pipeline for processing historical documents and had a couple of questions I’d love some insights on!

  1. PageXML Transformation: Has anyone worked on transforming Doc-UFCN’s JSON output (text lines, tables, etc.) into PageXML? Are there any existing tools, scripts, or hints in the docs that could guide this process?

  2. Scaling Coordinates: Since Doc-UFCN expects images scaled down (e.g., max dimension 768 pixels), I’m scaling my input images accordingly. When I get the polygon coordinates in the output, should I manually scale them back up to match the original image size? Or does Doc-UFCN have a built-in option to handle this scaling internally?

I’d really appreciate any tips or experiences you could share—thanks so much in advance for your help!

Best regards,
Constantin

Hi Constantin,

Thank you for your interest in our Doc-UFCN model!

  1. As far as I know, there aren’t any tools available yet for switching from Doc-UFCN-predicted json to PageXML but if you use the Arkindex platform to store images and annotations (manual or predicted), you can export them directly in PageXML format.

  2. The code is designed so that, from an input image, no matter its size, the output is scaled to that input image. If you resize your images beforehand to 768, the output will be such that the max dimension is 768 pixels. If you input the model with the image in its original size, the model will take care of resizing it, making the prediction, resizing the polygons to the original image size and outputting these polygons.

Best,
Mélodie

Dear Mélodie,

thank you very much for your response!

The second part in particular makes the use and how the predictions should best be made clearer.

Best regards,
Constantin