GithubHelp home page GithubHelp logo

lquirosd / p2pala Goto Github PK

View Code? Open in Web Editor NEW
189.0 14.0 42.0 869 KB

Page to PAGE Layout Analysis Tool

License: GNU General Public License v3.0

Python 96.78% Shell 2.94% R 0.28%
deep-neural-networks handwritten-text-recognition document-layout-analysis page-xml pytorch pix2pix gan generative-adversarial-network computer-vision image-segmentation

p2pala's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

p2pala's Issues

READ-ICDAR2019-cBAD dataset: Doesn't contain region ?

@lquirosd I am trying to train p2pala model on READ-ICDAR2019-cBAD dataset, but I am getting following:

Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
File cPAS-1803 do not contains regions
File cPAS-0098 do not contains baselines
File cPAS-0098 do not contains regions
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
Element type "Handwritten\u0020text"undefined on color dic, set to default=175
File cPAS-2756 do not contains regions
Element type "Machine\u0020Printed\u0020text"undefined on color dic, set to default=175
Element type "Machine\u0020Printed\u0020text"undefined on color dic, set to default=175
Element type "Machine\u0020Printed\u0020text"undefined on color dic, set to default=175
Element type "Machine\u0020Printed\u0020text"undefined on color dic, set to default=175

Here is the file : cPAS-1803.xml

<?xml version="1.0" encoding="UTF-8"?>
<PcGts xmlns="https://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15 https://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15/pagecontent.xsd">
    <Metadata>
        <Creator>TRP</Creator>
        <Created>2018-12-24T11:27:12+07:00</Created>
        <LastChange>2019-02-05T09:14:38Z</LastChange>
    </Metadata>
    <Page imageFilename="cPAS-1803.jpg" imageWidth="2172" imageHeight="2663">
        <TextRegion id="region_1547008260072_52" custom="readingOrder {index:0;} structure {type:Handwritten\u0020text;}">
            <Coords points="238,150 1362,150 1356,679 852,721 780,807 630,743 259,756"/>
            <TextLine id="line_1547008264947_53" custom="readingOrder {index:0;}">
                <Coords points="244,313 474,246 936,229 1348,259 1345,309 935,279 482,295 258,361"/>
                <Baseline points="257,356 481,290 935,274 1345,304"/>
            </TextLine>
            <TextLine id="line_1547008267806_54" custom="readingOrder {index:1;}">
                <Coords points="273,485 643,434 1254,397 1257,447 647,484 280,535"/>
                <Baseline points="279,530 647,479 1257,442"/>
            </TextLine>
            <TextLine id="line_1547008270697_55" custom="readingOrder {index:2;}">
                <Coords points="254,674 1312,615 1315,665 257,724"/>
                <Baseline points="257,719 1315,660"/>
            </TextLine>
        </TextRegion>
    </Page>
</PcGts>
python P2PaLA.py --gpu -1 --exp_name READ --work_dir ./work --log_level DEBUG --num_workers 4 --img_size 1024 768 --line_color 128 --line_width 8 --regions \$pag \$nop \$tip \$par \$not \$pac --merge_regions \$par:\$xxx --approx_alg optimal --num_segments 4 --batch_size 8 --input_channels 3 --out_mode LR --net_out_type C --cnn_ngf 64 --gan_layers 3 --loss_lambda 100 --g_loss L1 --adam_lr 0.001 --adam_beta1 0.5 --adam_beta2 0.999 --do_train --tr_data ./work/data/read/train/ --do_val --val_data ./work/data/read/val/ --no-do_prod --epochs 200 --use_gan --max_vertex 30 --e_stdv 6 --use_global_log ../runs/read 

Is there some change in PAGE-XML format ??

Baseline + polygon detection of handwriting

Hello. I have ran P2Pala succesfully against typewritten and print with the default model, but I am not getting very good results when running against handwriting. Is it possible to train a model to work against handwriting, and if so, what kind of ground truth, and how much is required?

How to see output polygon drawn on an input image?

Please advise on utility to draw the output baseline polygon on source image. I see an example on your online page(btw it doesn't work this time, skips the Process button).
But I can't fond a way to look at it on my machine.
If any built-in function please write the cli command: cmd data/source_img.jpg work/results_prod/page/source_img.xml
-> to produce drawn countor on source image.
In my run there are zero-size jpg files in work/results/prod
Probably it's a sort of error so it's interesting to draw xml lines over image(s).

require opencv-python-headless variant

The requirements.txt currently lists opencv-python, which drags in libraries for windowing systems like X11 – not ideal for headless servers. The Python bindings for OpenCV do offer other build variants like -contrib and -headless though (which are on PyPI for many platforms, and can also be built by ENABLE_HEADLESS=1 python setup.py bdist_wheel).

Therefore I suggest switching to opencv-python-headless instead.

Wights used on the Website demo

Hi
I used P2PaLA demo which you provide. Also, I downloaded the repo, pre-trained weights and everything. But I am getting very different results.

Is there some difference in configurations while running inference or is there some difference in pre-trained weights?
If there is a difference in pre-trained weights, can you share it?

Demo not working

I tried to use the demo. I uploaded the image but when I click 'Process' a pop-up appears and disappears immediately and nothing happens. The download button remains inactive.

Different predictions when changing the images order in prod_img_list

I've trained a custom model and I'm using it to predict regions from some images, but I have a problem when I use a file in opts.prod_img_list = images.txt which contains the list of the images to be predicted, but when I change the order of the list, the predictions show different results, even when I'm using the same images.

Cannot import 'misc'

When running P2PaLA.py from the current master branch state I get the following error:

  File "P2PaLA.py", line 26, in <module>
    from utils import misc
ImportError: cannot import name 'misc'

The utils subdirectory does not contain a file 'misc.py'

error while running the pre trained model in google colab

the error is as shown below:
2020-04-02 09:33:10,254 - optparse - INFO - Reading configuration from config_ALAR_min_model_17_12_18_inference.txt
2020-04-02 09:33:10,263 - P2PaLA - INFO - Working on prod inference...
2020-04-02 09:33:10,268 - P2PaLA - INFO - Results will be saved to ./work/results/prod
2020-04-02 09:33:10,844 - P2PaLA - INFO - Resumming from model ALAR_min_model_17_12_18.pth
2020-04-02 09:33:11,408 - P2PaLA - INFO - Preprocessing data from ./images
Premature end of JPEG file
Traceback (most recent call last):
File "P2PaLA.py", line 1268, in
main()
File "P2PaLA.py", line 1250, in main
out_folder=res_path,
File "/content/gdrive/My Drive/P2PaLA-master/data/imgprocess.py", line 187, in gen_page
os.path.realpath(self.img_data[img_id]), os.path.join(out_folder, img_name)
File "/content/gdrive/My Drive/P2PaLA-master/data/imgprocess.py", line 503, in symlink_force
raise e
File "/content/gdrive/My Drive/P2PaLA-master/data/imgprocess.py", line 497, in symlink_force
os.symlink(target, link_name)
OSError: [Errno 95] Operation not supported: '/content/gdrive/My Drive/P2PaLA-master/images/5.jpeg' -> './work/results/prod/5.jpeg'

[Enhancement] Page-XML extractor

To adapt the script to extract information/coordinates about page, from XML's formats most knowledge in the industry, like YOLO and PASCAL/VOC.

Observation: I could help with this task.

evaluation

Could you show how to use `evalTools' ? Thank you.

RTX cards require minimum Pytorch 1.0 [CUDNN_STATUS_EXECUTION_FAILED]

On my Linux mint 19.1 using an RTX 2070

When trying to recognize using the default installation:

(p3p) home@home-lnx:~/Desktop/programs/P2PaLA$ python P2PaLA.py --config config_ALAR_min_model_17_12_18.txt --prev_model ALAR_min_model_17_12_18.pth --prod_data ./images/
2019-01-21 13:42:19,280 - optparse - INFO - Reading configuration from config_ALAR_min_model_17_12_18.txt
2019-01-21 13:42:19,282 - P2PaLA - INFO - Working on prod inference...
2019-01-21 13:42:19,283 - P2PaLA - INFO - Results will be saved to ./work/results/prod
2019-01-21 13:42:19,599 - P2PaLA - INFO - Resumming from model ALAR_min_model_17_12_18.pth
/home/home/.conda/envs/p3p/lib/python3.6/site-packages/torch/cuda/__init__.py:95: UserWarning: 
    Found GPU0 GeForce RTX 2070 which requires CUDA_VERSION >= 9000 for
     optimal performance and fast startup time, but your PyTorch was compiled
     with CUDA_VERSION 8000. Please install the correct PyTorch binary
     using instructions from http://pytorch.org
    
  warnings.warn(incorrect_binary_warn % (d, name, 9000, CUDA_VERSION))

So I installed latest torch and torchvision:

(p3p) home@home-lnx:~/Desktop/programs/P2PaLA$ pip install --ignore-installed torch torchvision

Then ran recognition:

(p3p) home@home-lnx:~/Desktop/programs/P2PaLA$ python P2PaLA.py --config config_ALAR_min_model_17_12_18.txt --prev_model ALAR_min_model_17_12_18.pth --prod_data ./images/
/home/home/.conda/envs/p3p/lib/python3.6/site-packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
  warnings.warn(warning.format(ret))
2019-01-21 13:58:31,771 - optparse - INFO - Reading configuration from config_ALAR_min_model_17_12_18.txt
2019-01-21 13:58:31,773 - P2PaLA - INFO - Working on prod inference...
2019-01-21 13:58:31,774 - P2PaLA - INFO - Results will be saved to ./work/results/prod
2019-01-21 13:58:32,125 - P2PaLA - INFO - Resumming from model ALAR_min_model_17_12_18.pth
2019-01-21 13:58:34,859 - P2PaLA - INFO - Preprocessing data from ./images/
P2PaLA.py:1195: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  pr_x = Variable(sample["image"], volatile=True)
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
2019-01-21 13:58:35,463 - P2PaLA - INFO - Production stage done. total time taken: 0.604010820388794
2019-01-21 13:58:35,463 - P2PaLA - INFO - Average time per page: 0.604010820388794
2019-01-21 13:58:35,463 - P2PaLA - INFO - All Done...

Now the problem is when trying to train

(p3p) home@home-lnx:~/Desktop/programs/P2PaLA$ python P2PaLA.py --config config_BL_only.txt --tr_data ./data/train --te_data ./data/test --log_comment "_foo"
/home/home/.conda/envs/p3p/lib/python3.6/site-packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
  warnings.warn(warning.format(ret))
2019-01-21 14:06:09,788 - optparse - INFO - Reading configuration from config_BL_only.txt
2019-01-21 14:06:09,789 - optparse - DEBUG - Creating output dir: ./work_BL_only
2019-01-21 14:06:09,790 - optparse - DEBUG - Creating checkpoints dir: ./work_BL_only/checkpoints
2019-01-21 14:06:09,790 - P2PaLA - INFO - Working on training stage...
2019-01-21 14:06:09,791 - P2PaLA - WARNING - tensorboardX is not installed, display logger set to OFF.
2019-01-21 14:06:09,791 - P2PaLA - INFO - Preprocessing data from ./data/train
/home/home/Desktop/programs/P2PaLA/nn_models/models.py:293: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform_.
  init.uniform(m.weight.data, 0.0, 0.02)
/home/home/Desktop/programs/P2PaLA/nn_models/models.py:298: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform_.
  init.uniform(m.weight.data, 1.0, 0.02)
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
Traceback (most recent call last):
  File "P2PaLA.py", line 1262, in <module>
    main()
  File "P2PaLA.py", line 606, in main
    epoch_lossD += d_loss.data[0]
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

Weights initialisation error

I'm trying to reproduce the cBAD_complex training but I get the following error when running the run.sh script.

Have you already encountered it?

FYI: I have torch 1.3.1.

tf-docker ~/workspace/P2PaLA/egs/cBAD_complex > python ../../P2PaLA.py --config config.txt --log_comment "cBAD_corpus"
2019-11-29 11:05:33,786 - optparse - INFO - Reading configuration from config.txt
2019-11-29 11:05:33,800 - P2PaLA - INFO - Working on training stage...
2019-11-29 11:05:33,921 - P2PaLA - INFO - TensorBoard log will be stored at ./work/runs/Nov29_11-05-33_ABC_cBAD_corpus
2019-11-29 11:05:33,921 - P2PaLA - INFO - run: tensorboard --logdir ./work/runs
2019-11-29 11:05:33,921 - P2PaLA - INFO - Preprocessing data from data/train/
File cBAD_complex_train_109 do not contains baselines
File cBAD_complex_train_2 do not contains baselines
File cBAD_complex_train_244 do not contains baselines
File cBAD_complex_train_268 do not contains baselines
File cBAD_complex_train_80 do not contains baselines
File cBAD_complex_train_8 do not contains baselines
File cBAD_complex_train_39 do not contains baselines
File cBAD_complex_train_13 do not contains baselines
File cBAD_complex_train_111 do not contains baselines
File cBAD_complex_train_11 do not contains baselines
File cBAD_complex_train_7 do not contains baselines
File cBAD_complex_train_258 do not contains baselines
File cBAD_complex_train_10 do not contains baselines
File cBAD_complex_train_9 do not contains baselines
File cBAD_complex_train_27 do not contains baselines
File cBAD_complex_train_90 do not contains baselines
File cBAD_complex_train_22 do not contains baselines
File cBAD_complex_train_67 do not contains baselines
File cBAD_complex_train_245 do not contains baselines
File cBAD_complex_train_23 do not contains baselines
Traceback (most recent call last):
File "../../P2PaLA.py", line 1269, in
main()
File "../../P2PaLA.py", line 460, in main
nnG.apply(models.weights_init_normal)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 287, in apply
module.apply(fn)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 287, in apply
module.apply(fn)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 287, in apply
module.apply(fn)
[Previous line repeated 2 more times]
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 288, in apply
fn(self)
File "/root/workspace/P2PaLA/nn_models/models.py", line 298, in weights_init_normal
nn.init.uniform
(m.weight.data, 1.0, 0.02)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/init.py", line 88, in uniform_
return no_grad_uniform(tensor, a, b)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/init.py", line 14, in no_grad_uniform
return tensor.uniform_(a, b)
RuntimeError: uniform_ expects to return a [from, to) range, but found from=1 > to=0.02

General

Discussing general topic.

"No region type defined for r1 at 00001096"

I've used P2PaLA to train a Document Layout Analysis model for zone segmentation with PRImA Layout Analysis Dataset. PRImA dataset use PAGE XML with 2010 schema version.
When model load data from corpus, I've got:

No region type defined for r1 at 0000001096
Element type "Node" undefined on color dic, set to default=175

This message have happened for all <TextRegion> in the XML file. After training phase have done, I see the result/test and nothing was predicted.
I don't know what it mean. Please help me.
Thanks.

model for zone segmentation

Hello,
May I ask do you have any plan to public pretrained model for zone segmentation, or any config that I can train with my data?
Thank you very much

File do not contain region.

@lquirosd I am trying to train P2PALA model on both baseline and region.

python P2PaLA.py --exp_name test_run --gpu -1 --seed 1 --use_global_log ./tensorboard_output --log_comment "_foo" --no-pin_memory --out_mode LR --use_gan --tr_data ./work/data/train2 --do_val --val_data ./work/data/val2

Following is one of the XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PcGts xmlns="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15 http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15/pagecontent.xsd">
    <Metadata>
        <Creator>TRP</Creator>
        <Created>2014-09-25T12:35:47.179+02:00</Created>
        <LastChange>2018-06-11T15:01:18.835+02:00</LastChange>
    </Metadata>
    <Page imageFilename="Seite0357.JPG" imageWidth="2338" imageHeight="3511">
        <ReadingOrder>
            <OrderedGroup id="ro_1528722078914" caption="Regions reading order">
                <RegionRefIndexed index="0" regionRef="region_1f24d622-a557-48b5-aa3f-e1ae5841bb7a"/>
                <RegionRefIndexed index="1" regionRef="region_01df7a4c-4993-4ec1-8bb8-f75fa854498d"/>
            </OrderedGroup>
        </ReadingOrder>
        <TextRegion  id="region_1f24d622-a557-48b5-aa3f-e1ae5841bb7a" custom="readingOrder {index:0;} structure {type:page-number;}">
            <Coords points="1664,208 1925,208 1925,325 1664,325"/>
            <TextLine id="line_33d15b73-b080-4fde-918a-d8896ac0699e" custom="readingOrder {index:0;} structure {type:page-number;}">
                <Coords points="1900,227 1683,235 1683,305 1900,297"/>
                <Baseline points="1683,298 1900,290"/>
                <TextEquiv>
                    <Unicode>178</Unicode>
                </TextEquiv>
            </TextLine>
            <TextEquiv>
                <Unicode>178</Unicode>
            </TextEquiv>
        </TextRegion>
        <TextRegion  id="region_01df7a4c-4993-4ec1-8bb8-f75fa854498d" custom="readingOrder {index:1;} structure {type:paragraph;}">
            <Coords points="603,469 1929,469 1974,1777 1946,2148 2069,2361 1929,2704 603,2704"/>
            <TextLine id="line_b9287b47-860e-4ca6-8847-74b2c67b777b" custom="readingOrder {index:0;} structure {type:paragraph;}">
                <Coords points="1869,512 1444,497 696,481 696,604 1444,620 1869,635"/>
                <Baseline points="696,579 1444,595 1869,610"/>
                <TextEquiv>
                    <Unicode>die stetigs Ire Pixen, Wöhrn</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_6e8fcbcc-0f44-4c32-ab81-458cf088fcd1" custom="readingOrder {index:1;} structure {type:paragraph;}">
                <Coords points="1815,641 1340,637 707,617 707,721 1340,741 1815,745"/>
                <Baseline points="707,687 1340,707 1815,711"/>
                <TextEquiv>
                    <Unicode>vnd waffen haimblich vnd</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_2cabe657-3c84-449a-911d-c280708a261e" custom="readingOrder {index:2;} structure {type:paragraph;}">
                <Coords points="1915,753 1240,719 696,715 696,835 1240,839 1915,873"/>
                <Baseline points="696,811 1240,815 1915,849"/>
                <TextEquiv>
                    <Unicode>offenlich herūmb tragen. welhes</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_7cd460dc-f18c-4b77-9f1b-ac6ccda89a49" custom="readingOrder {index:3;} structure {type:paragraph;}">
                <Coords points="1749,879 1136,840 704,848 704,941 1136,933 1749,972"/>
                <Baseline points="704,915 1136,907 1749,946"/>
                <TextEquiv>
                    <Unicode>sonderlich Marckhts Zeiten</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_918df727-5423-4df6-8a01-50223f8efc99" custom="readingOrder {index:4;} structure {type:paragraph;} abbrev {offset:17; length:7;expansion:khomenden;}">
                <Coords points="1838,978 1232,955 704,947 704,1045 1232,1053 1838,1076"/>
                <Baseline points="704,1019 1232,1027 1838,1050"/>
                <TextEquiv>
                    <Unicode>Alda Jedem Alher khomend</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_3ef11782-85a8-4081-935f-c6c02041dd34" custom="readingOrder {index:5;} structure {type:paragraph;}">
                <Coords points="1846,1082 1244,1059 680,1051 680,1149 1244,1157 1846,1180"/>
                <Baseline points="680,1123 1244,1131 1846,1154"/>
                <TextEquiv>
                    <Unicode>Kaūff: vnd handlsman. vnd</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_c12e52b7-369e-4977-876e-94cc446250d4" custom="readingOrder {index:6;} structure {type:paragraph;}">
                <Coords points="1884,1186 1205,1171 707,1155 707,1255 1205,1271 1884,1286"/>
                <Baseline points="707,1227 1205,1243 1884,1258"/>
                <TextEquiv>
                    <Unicode>Anndern frembden Personen</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_f30b1253-80ae-4f9d-9eb9-26e7d5c89594" custom="readingOrder {index:7;} structure {type:paragraph;}">
                <Coords points="1842,1293 1259,1258 700,1262 700,1374 1259,1370 1842,1405"/>
                <Baseline points="700,1343 1259,1339 1842,1374"/>
                <TextEquiv>
                    <Unicode>wer die seind. vermig der</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_1333a76b-c4c7-41f0-bdb4-12e757f041b7" custom="readingOrder {index:8;} structure {type:paragraph;}">
                <Coords points="1900,1413 1614,1379 1078,1359 719,1359 719,1471 1078,1471 1614,1491 1900,1525"/>
                <Baseline points="719,1447 1078,1447 1614,1467 1900,1501"/>
                <TextEquiv>
                    <Unicode>offenlichen Marckhtsberūeff¬</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_b2fef3bc-ffdb-4453-a8c3-c6058529f898" custom="readingOrder {index:9;} structure {type:paragraph;}">
                <Coords points="1880,1531 1271,1488 711,1484 711,1573 1271,1577 1880,1620"/>
                <Baseline points="711,1551 1271,1555 1880,1598"/>
                <TextEquiv>
                    <Unicode>ūng. vnd sonder barer vor</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_97beca06-11dd-4bb8-8246-e9f9da88189e" custom="readingOrder {index:10;} structure {type:paragraph;} abbrev {offset:18; length:4;expansion:Fürstlichen;}">
                <Coords points="1768,1625 1236,1605 700,1594 700,1684 1236,1695 1768,1715"/>
                <Baseline points="700,1656 1236,1667 1768,1687"/>
                <TextEquiv>
                    <Unicode>disem Aūsganngner Frl:</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_3d9dc680-7ce9-4fdb-ada2-ec2a1dab6bf9" custom="readingOrder {index:11;} structure {type:paragraph;}">
                <Coords points="1957,1722 1282,1688 711,1672 711,1780 1282,1796 1957,1830"/>
                <Baseline points="711,1753 1282,1769 1957,1803"/>
                <TextEquiv>
                    <Unicode>Mandaten. dergleichen Wöhrn</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_f4e9aa6b-4368-4c0c-9c12-e9b4e284dec6" custom="readingOrder {index:12;} structure {type:paragraph;}">
                <Coords points="1861,1836 1260,1798 718,1784 718,1885 1260,1899 1861,1937"/>
                <Baseline points="718,1861 1260,1875 1861,1913"/>
                <TextEquiv>
                    <Unicode>bei sich Zūtragen bei hechster</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_92eeee8c-7d84-4df6-841a-840605bf6bc2" custom="readingOrder {index:13;} structure {type:paragraph;}">
                <Coords points="1757,1942 1222,1920 711,1904 711,2002 1222,2018 1757,2040"/>
                <Baseline points="711,1971 1222,1987 1757,2009"/>
                <TextEquiv>
                    <Unicode>Straff verboten wirdet,</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_2ca8f6f9-066a-4dda-9269-ddfae4f7f755" custom="readingOrder {index:14;} structure {type:paragraph;}">
                <Coords points="1856,2047 1265,2011 722,1996 722,2104 1265,2119 1856,2155"/>
                <Baseline points="722,2084 1265,2099 1856,2135"/>
                <TextEquiv>
                    <Unicode>beforderist Alhie. Als ainem</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_e38dad75-3c18-455a-9c10-65851d705adf" custom="readingOrder {index:15;} structure {type:paragraph;}">
                <Coords points="1842,2160 1376,2149 714,2133 714,2221 1376,2237 1842,2248"/>
                <Baseline points="714,2190 1376,2206 1842,2217"/>
                <TextEquiv>
                    <Unicode>offnen vnūersperten Orth.</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_9d49bb7e-8712-414f-b529-62fdb799942a" custom="readingOrder {index:16;} structure {type:paragraph;} abbrev {offset:26; length:6;expansion:welschen;}">
                <Coords points="1954,2255 1740,2245 1360,2225 710,2209 710,2319 1360,2335 1740,2355 1954,2365"/>
                <Baseline points="710,2295 1360,2311 1740,2331 1954,2341"/>
                <TextEquiv>
                    <Unicode>Zwischen den Teitsch. vnd welsch</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_844ef0d9-ba9a-455b-aded-db437704708f" custom="readingOrder {index:17;} structure {type:paragraph;}">
                <Coords points="1878,2371 1583,2355 1192,2344 698,2326 698,2422 1192,2440 1583,2451 1878,2467"/>
                <Baseline points="698,2395 1192,2413 1583,2424 1878,2440"/>
                <TextEquiv>
                    <Unicode>Hanndlsleüten vnd Personen.</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_a294c1a1-2227-46da-8953-25e5a5fac926" custom="readingOrder {index:18;} structure {type:paragraph;}">
                <Coords points="1858,2474 1323,2445 718,2427 718,2527 1323,2545 1858,2574"/>
                <Baseline points="718,2504 1323,2522 1858,2551"/>
                <TextEquiv>
                    <Unicode>sonnderlich bei Nechtlichen</Unicode>
                </TextEquiv>
            </TextLine>
            <TextLine id="line_72ebf6ae-669b-4798-8c31-64ecca4cbd6a" custom="readingOrder {index:19;} structure {type:paragraph;}">
                <Coords points="1838,2580 1174,2560 718,2538 718,2618 1174,2640 1838,2660"/>
                <Baseline points="718,2603 1174,2625 1838,2645"/>
                <TextEquiv>
                    <Unicode>Zeiten, Zū besorgen. Ain böse </Unicode>
                </TextEquiv>
            </TextLine>
            <TextEquiv>
                <Unicode>die stetigs Ire Pixen, Wöhrn
vnd waffen haimblich vnd
offenlich herūmb tragen. welhes
sonderlich Marckhts Zeiten
Alda Jedem Alher khomend
Kaūff: vnd handlsman. vnd
Anndern frembden Personen
wer die seind. vermig der
offenlichen Marckhtsberūeff¬
ūng. vnd sonder barer vor
disem Aūsganngner Frl:
Mandaten. dergleichen Wöhrn
bei sich Zūtragen bei hechster
Straff verboten wirdet,
beforderist Alhie. Als ainem
offnen vnūersperten Orth.
Zwischen den Teitsch. vnd welsch
Hanndlsleüten vnd Personen.
sonnderlich bei Nechtlichen
Zeiten, Zū besorgen. Ain böse </Unicode>
            </TextEquiv>
        </TextRegion>
    </Page>
</PcGts>

I am getting following in the logs:

File Seite0395 do not contains regions
Element type "page-number"undefined on color dic, set to default=175
Element type "page-number"undefined on color dic, set to default=175
Element type "paragraph"undefined on color dic, set to default=175
Element type "paragraph"undefined on color dic, set to default=175
File Seite0357 do not contains regions
Element type "page-number"undefined on color dic, set to default=175
Element type "page-number"undefined on color dic, set to default=175
Element type "paragraph"undefined on color dic, set to default=175
Element type "paragraph"undefined on color dic, set to default=175
Element type "marginalia"undefined on color dic, set to default=175
Element type "marginalia"undefined on color dic, set to default=175
File Seite0388 do not contains regions

From the XML file I can see that the region is defined in the file, what I am doing wrong ?

XML generator

Hello.

How can I generate new png XML? Do you use any tool to handle it?

[config]

Any config.txt example pls???

minor typo in command

since most people coyping the commands:

  1. For detail about arguments and config file, see docs or python P2PaLa.py -h. -> should be python P2PaLA.py -h

JoseRPrietoF version?

@JoseRPrietoF
What is different in your version of P2PaLA?

Modified version to do table segmentation and act separation on Passau and Chancery corpus.

  • what do you mean by act separation?
  • also, when you say table segmentation, do you mean it detects baseline, and then extracts text?

Any chance to see more pre-trained models?

Hello,
I played a little with the provided model with the weights ALAR_min_model_17_12_18.pth
As to the word min in the name I wonder ther are other models.
Do you plan to publish it?

I've thouigh out some tricks to improve the accuracy of coverage the htr text regions but it's still rough. In many cases important parts of letters are cropped out.
I don't have neither hardware nor labeled datasets for the trainig.
Could you share a more powerful model?

TextLine region

@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

Does P2Pala support reading order?

I fed data to P2PALA with reading order (custom="readingOrder {index:8;}"), but in the output it's missing, and the order of the XML tags in PAGE format is pretty messed up (it reads from bottom of the text region to the top of it, but from left to the right)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.