Test cases for --tesseract-timeout
This commit is contained in:
+20
-11
@@ -610,33 +610,42 @@ def render_hocr_debug_page(
|
||||
|
||||
|
||||
@active_if(options.pdf_renderer == 'tesseract')
|
||||
@transform(
|
||||
input=preprocess_clean,
|
||||
filter=suffix(".pp-clean.png"),
|
||||
output=".rendered.pdf",
|
||||
@collate(
|
||||
input=[preprocess_clean, split_pages],
|
||||
filter=regex(r".*/(\d{6})(?:\.pp-clean\.png|\.page\.pdf)"),
|
||||
output=os.path.join(work_folder, r'\1.rendered.pdf'),
|
||||
extras=[_log, _pdfinfo, _pdfinfo_lock])
|
||||
def tesseract_ocr_and_render_pdf(
|
||||
input_file,
|
||||
input_files,
|
||||
output_file,
|
||||
log,
|
||||
pdfinfo,
|
||||
pdfinfo_lock):
|
||||
|
||||
input_image = next(ii for ii in input_files if ii.endswith('.png'))
|
||||
|
||||
args_tesseract = [
|
||||
'tesseract',
|
||||
'-l', '+'.join(options.language),
|
||||
input_file,
|
||||
input_image,
|
||||
os.path.splitext(output_file)[0], # Tesseract appends suffix
|
||||
'pdf'
|
||||
] + options.tesseract_config
|
||||
p = Popen(args_tesseract, close_fds=True, stdout=PIPE, stderr=PIPE,
|
||||
universal_newlines=True)
|
||||
|
||||
stdout, stderr = p.communicate(timeout=options.tesseract_timeout)
|
||||
if stdout:
|
||||
log.info(stdout)
|
||||
if stderr:
|
||||
log.error(stderr)
|
||||
try:
|
||||
stdout, stderr = p.communicate(timeout=options.tesseract_timeout)
|
||||
if stdout:
|
||||
log.info(stdout)
|
||||
if stderr:
|
||||
log.error(stderr)
|
||||
except TimeoutError:
|
||||
p.kill()
|
||||
|
||||
input_pdf = next(ii for ii in input_files if ii.endswith('.pdf'))
|
||||
log.info("Tesseract - page timed out")
|
||||
re_symlink(input_pdf, output_file)
|
||||
|
||||
|
||||
@transform(
|
||||
|
||||
+155
-150
@@ -4,227 +4,232 @@
|
||||
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
|
||||
-->
|
||||
<!-- Title: Pipeline: Pages: 1 -->
|
||||
<svg width="752pt" height="651pt"
|
||||
viewBox="0.00 0.00 752.00 650.53" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="728pt" height="651pt"
|
||||
viewBox="0.00 0.00 728.00 650.53" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 646.53)">
|
||||
<title>Pipeline:</title>
|
||||
<polygon fill="white" stroke="none" points="-4,4 -4,-646.53 748,-646.53 748,4 -4,4"/>
|
||||
<polygon fill="white" stroke="none" points="-4,4 -4,-646.53 724,-646.53 724,4 -4,4"/>
|
||||
<g id="clust1" class="cluster"><title>clustertasks</title>
|
||||
<polygon fill="none" stroke="black" points="8,-8 8,-634.53 736,-634.53 736,-8 8,-8"/>
|
||||
<text text-anchor="middle" x="372" y="-606.53" font-family="Times,serif" font-size="30.00" fill="#ff3232">Pipeline:</text>
|
||||
<polygon fill="none" stroke="black" points="8,-8 8,-634.53 712,-634.53 712,-8 8,-8"/>
|
||||
<text text-anchor="middle" x="360" y="-606.53" font-family="Times,serif" font-size="30.00" fill="#ff3232">Pipeline:</text>
|
||||
</g>
|
||||
<!-- t0 -->
|
||||
<g id="node1" class="node"><title>t0</title>
|
||||
<polygon fill="#efa03b" stroke="#006000" points="489.791,-588.53 394.209,-588.53 390.209,-584.53 390.209,-552.53 485.791,-552.53 489.791,-556.53 489.791,-588.53"/>
|
||||
<polyline fill="none" stroke="#006000" points="485.791,-584.53 390.209,-584.53 "/>
|
||||
<polyline fill="none" stroke="#006000" points="485.791,-584.53 485.791,-552.53 "/>
|
||||
<polyline fill="none" stroke="#006000" points="485.791,-584.53 489.791,-588.53 "/>
|
||||
<text text-anchor="middle" x="440" y="-564.53" font-family="Times,serif" font-size="20.00" fill="#006000">repair_pdf</text>
|
||||
<polygon fill="#efa03b" stroke="#006000" points="481.791,-588.53 386.209,-588.53 382.209,-584.53 382.209,-552.53 477.791,-552.53 481.791,-556.53 481.791,-588.53"/>
|
||||
<polyline fill="none" stroke="#006000" points="477.791,-584.53 382.209,-584.53 "/>
|
||||
<polyline fill="none" stroke="#006000" points="477.791,-584.53 477.791,-552.53 "/>
|
||||
<polyline fill="none" stroke="#006000" points="477.791,-584.53 481.791,-588.53 "/>
|
||||
<text text-anchor="middle" x="432" y="-564.53" font-family="Times,serif" font-size="20.00" fill="#006000">repair_pdf</text>
|
||||
</g>
|
||||
<!-- t1 -->
|
||||
<g id="node2" class="node"><title>t1</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="474.782,-509.564 382,-526.497 289.218,-509.564 289.304,-482.165 474.696,-482.165 474.782,-509.564"/>
|
||||
<polygon fill="none" stroke="black" points="478.799,-512.902 382,-530.569 285.201,-512.902 285.311,-478.159 478.689,-478.159 478.799,-512.902"/>
|
||||
<text text-anchor="middle" x="382" y="-495.991" font-family="Times,serif" font-size="20.00">split_pages</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="466.782,-509.564 374,-526.497 281.218,-509.564 281.304,-482.165 466.696,-482.165 466.782,-509.564"/>
|
||||
<polygon fill="none" stroke="black" points="470.799,-512.902 374,-530.569 277.201,-512.902 277.311,-478.159 470.689,-478.159 470.799,-512.902"/>
|
||||
<text text-anchor="middle" x="374" y="-495.991" font-family="Times,serif" font-size="20.00">split_pages</text>
|
||||
</g>
|
||||
<!-- t0->t1 -->
|
||||
<g id="edge1" class="edge"><title>t0->t1</title>
|
||||
<path fill="none" stroke="gray" d="M425.064,-552.394C420.296,-546.925 414.86,-540.689 409.493,-534.532"/>
|
||||
<polygon fill="gray" stroke="gray" points="411.996,-532.077 402.787,-526.838 406.719,-536.676 411.996,-532.077"/>
|
||||
<path fill="none" stroke="gray" d="M417.064,-552.394C412.296,-546.925 406.86,-540.689 401.493,-534.532"/>
|
||||
<polygon fill="gray" stroke="gray" points="403.996,-532.077 394.787,-526.838 398.719,-536.676 403.996,-532.077"/>
|
||||
</g>
|
||||
<!-- t10 -->
|
||||
<g id="node12" class="node"><title>t10</title>
|
||||
<polygon fill="#efa03b" stroke="#006000" points="728.338,-451.452 517.662,-451.452 513.662,-447.452 513.662,-415.452 724.338,-415.452 728.338,-419.452 728.338,-451.452"/>
|
||||
<polyline fill="none" stroke="#006000" points="724.338,-447.452 513.662,-447.452 "/>
|
||||
<polyline fill="none" stroke="#006000" points="724.338,-447.452 724.338,-415.452 "/>
|
||||
<polyline fill="none" stroke="#006000" points="724.338,-447.452 728.338,-451.452 "/>
|
||||
<text text-anchor="middle" x="621" y="-427.452" font-family="Times,serif" font-size="20.00" fill="#006000">generate_postscript_stub</text>
|
||||
<polygon fill="#efa03b" stroke="#006000" points="704.338,-451.452 493.662,-451.452 489.662,-447.452 489.662,-415.452 700.338,-415.452 704.338,-419.452 704.338,-451.452"/>
|
||||
<polyline fill="none" stroke="#006000" points="700.338,-447.452 489.662,-447.452 "/>
|
||||
<polyline fill="none" stroke="#006000" points="700.338,-447.452 700.338,-415.452 "/>
|
||||
<polyline fill="none" stroke="#006000" points="700.338,-447.452 704.338,-451.452 "/>
|
||||
<text text-anchor="middle" x="597" y="-427.452" font-family="Times,serif" font-size="20.00" fill="#006000">generate_postscript_stub</text>
|
||||
</g>
|
||||
<!-- t0->t10 -->
|
||||
<g id="edge15" class="edge"><title>t0->t10</title>
|
||||
<path fill="none" stroke="gray" d="M462.924,-552.422C495.068,-528.433 553.637,-484.724 589.75,-457.773"/>
|
||||
<polygon fill="gray" stroke="gray" points="592.056,-460.42 597.977,-451.634 587.87,-454.81 592.056,-460.42"/>
|
||||
<g id="edge16" class="edge"><title>t0->t10</title>
|
||||
<path fill="none" stroke="gray" d="M453.048,-552.468C461.441,-545.654 471.185,-537.73 480,-530.53 510.227,-505.84 544.753,-477.467 568.421,-457.99"/>
|
||||
<polygon fill="gray" stroke="gray" points="570.818,-460.55 576.315,-451.493 566.369,-455.146 570.818,-460.55"/>
|
||||
</g>
|
||||
<!-- t2 -->
|
||||
<g id="node3" class="node"><title>t2</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="495.555,-451.452 272.445,-451.452 268.445,-447.452 268.445,-415.452 491.555,-415.452 495.555,-419.452 495.555,-451.452"/>
|
||||
<polyline fill="none" stroke="black" points="491.555,-447.452 268.445,-447.452 "/>
|
||||
<polyline fill="none" stroke="black" points="491.555,-447.452 491.555,-415.452 "/>
|
||||
<polyline fill="none" stroke="black" points="491.555,-447.452 495.555,-451.452 "/>
|
||||
<text text-anchor="middle" x="382" y="-427.452" font-family="Times,serif" font-size="20.00">rasterize_with_ghostscript</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="451.555,-451.452 228.445,-451.452 224.445,-447.452 224.445,-415.452 447.555,-415.452 451.555,-419.452 451.555,-451.452"/>
|
||||
<polyline fill="none" stroke="black" points="447.555,-447.452 224.445,-447.452 "/>
|
||||
<polyline fill="none" stroke="black" points="447.555,-447.452 447.555,-415.452 "/>
|
||||
<polyline fill="none" stroke="black" points="447.555,-447.452 451.555,-451.452 "/>
|
||||
<text text-anchor="middle" x="338" y="-427.452" font-family="Times,serif" font-size="20.00">rasterize_with_ghostscript</text>
|
||||
</g>
|
||||
<!-- t1->t2 -->
|
||||
<g id="edge2" class="edge"><title>t1->t2</title>
|
||||
<path fill="none" stroke="#0044a0" d="M382,-478.092C382,-472.777 382,-467.07 382,-461.593"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="385.5,-461.506 382,-451.506 378.5,-461.506 385.5,-461.506"/>
|
||||
<path fill="none" stroke="#0044a0" d="M361.611,-478.092C358.514,-472.369 355.171,-466.19 352.003,-460.333"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="355.064,-458.636 347.227,-451.506 348.907,-461.967 355.064,-458.636"/>
|
||||
</g>
|
||||
<!-- t11 -->
|
||||
<g id="node10" class="node"><title>t11</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="159.594,-393.452 66.4062,-393.452 62.4062,-389.452 62.4062,-357.452 155.594,-357.452 159.594,-361.452 159.594,-393.452"/>
|
||||
<polyline fill="none" stroke="black" points="155.594,-389.452 62.4062,-389.452 "/>
|
||||
<polyline fill="none" stroke="black" points="155.594,-389.452 155.594,-357.452 "/>
|
||||
<polyline fill="none" stroke="black" points="155.594,-389.452 159.594,-393.452 "/>
|
||||
<text text-anchor="middle" x="111" y="-369.452" font-family="Times,serif" font-size="20.00">skip_page</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="644.594,-393.452 551.406,-393.452 547.406,-389.452 547.406,-357.452 640.594,-357.452 644.594,-361.452 644.594,-393.452"/>
|
||||
<polyline fill="none" stroke="black" points="640.594,-389.452 547.406,-389.452 "/>
|
||||
<polyline fill="none" stroke="black" points="640.594,-389.452 640.594,-357.452 "/>
|
||||
<polyline fill="none" stroke="black" points="640.594,-389.452 644.594,-393.452 "/>
|
||||
<text text-anchor="middle" x="596" y="-369.452" font-family="Times,serif" font-size="20.00">skip_page</text>
|
||||
</g>
|
||||
<!-- t1->t11 -->
|
||||
<g id="edge13" class="edge"><title>t1->t11</title>
|
||||
<path fill="none" stroke="#0044a0" d="M322.128,-478.077C301.919,-470.026 279.335,-460.679 259,-451.452 222.194,-434.751 181.273,-413.827 151.805,-398.326"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="153.137,-395.071 142.66,-393.496 149.868,-401.261 153.137,-395.071"/>
|
||||
</g>
|
||||
<!-- t3 -->
|
||||
<g id="node4" class="node"><title>t3</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="467.999,-393.452 300.001,-393.452 296.001,-389.452 296.001,-357.452 463.999,-357.452 467.999,-361.452 467.999,-393.452"/>
|
||||
<polyline fill="none" stroke="black" points="463.999,-389.452 296.001,-389.452 "/>
|
||||
<polyline fill="none" stroke="black" points="463.999,-389.452 463.999,-357.452 "/>
|
||||
<polyline fill="none" stroke="black" points="463.999,-389.452 467.999,-393.452 "/>
|
||||
<text text-anchor="middle" x="382" y="-369.452" font-family="Times,serif" font-size="20.00">preprocess_deskew</text>
|
||||
</g>
|
||||
<!-- t2->t3 -->
|
||||
<g id="edge3" class="edge"><title>t2->t3</title>
|
||||
<path fill="none" stroke="#0044a0" d="M382,-415.346C382,-411.655 382,-407.665 382,-403.695"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="385.5,-403.453 382,-393.453 378.5,-403.453 385.5,-403.453"/>
|
||||
</g>
|
||||
<!-- t6 -->
|
||||
<g id="node6" class="node"><title>t6</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="634.375,-277.452 447.625,-277.452 443.625,-273.452 443.625,-241.452 630.375,-241.452 634.375,-245.452 634.375,-277.452"/>
|
||||
<polyline fill="none" stroke="black" points="630.375,-273.452 443.625,-273.452 "/>
|
||||
<polyline fill="none" stroke="black" points="630.375,-273.452 630.375,-241.452 "/>
|
||||
<polyline fill="none" stroke="black" points="630.375,-273.452 634.375,-277.452 "/>
|
||||
<text text-anchor="middle" x="539" y="-253.452" font-family="Times,serif" font-size="20.00">select_image_for_pdf</text>
|
||||
</g>
|
||||
<!-- t2->t6 -->
|
||||
<g id="edge7" class="edge"><title>t2->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M442.809,-415.378C455.168,-409.854 467.327,-402.684 477,-393.452 507.53,-364.315 524.51,-317.195 532.692,-287.567"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="536.178,-288.068 535.317,-277.508 529.405,-286.3 536.178,-288.068"/>
|
||||
</g>
|
||||
<!-- t4 -->
|
||||
<g id="node5" class="node"><title>t4</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="439.705,-335.452 290.295,-335.452 286.295,-331.452 286.295,-299.452 435.705,-299.452 439.705,-303.452 439.705,-335.452"/>
|
||||
<polyline fill="none" stroke="black" points="435.705,-331.452 286.295,-331.452 "/>
|
||||
<polyline fill="none" stroke="black" points="435.705,-331.452 435.705,-299.452 "/>
|
||||
<polyline fill="none" stroke="black" points="435.705,-331.452 439.705,-335.452 "/>
|
||||
<text text-anchor="middle" x="363" y="-311.452" font-family="Times,serif" font-size="20.00">preprocess_clean</text>
|
||||
</g>
|
||||
<!-- t3->t4 -->
|
||||
<g id="edge4" class="edge"><title>t3->t4</title>
|
||||
<path fill="none" stroke="#0044a0" d="M376.196,-357.346C374.87,-353.438 373.43,-349.194 372.006,-344.995"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="375.296,-343.799 368.768,-335.453 368.667,-346.048 375.296,-343.799"/>
|
||||
</g>
|
||||
<!-- t3->t6 -->
|
||||
<g id="edge6" class="edge"><title>t3->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M413.697,-357.449C425.088,-350.965 437.865,-343.25 449,-335.452 471.538,-319.668 495.388,-299.622 512.871,-284.226"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="515.277,-286.77 520.427,-277.512 510.627,-281.538 515.277,-286.77"/>
|
||||
</g>
|
||||
<!-- t4->t6 -->
|
||||
<g id="edge5" class="edge"><title>t4->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M416.762,-299.346C435.442,-293.402 456.56,-286.683 475.923,-280.522"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="477.099,-283.821 485.567,-277.453 474.977,-277.15 477.099,-283.821"/>
|
||||
</g>
|
||||
<!-- t5 -->
|
||||
<g id="node7" class="node"><title>t5</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="425.922,-277.452 264.078,-277.452 260.078,-273.452 260.078,-241.452 421.922,-241.452 425.922,-245.452 425.922,-277.452"/>
|
||||
<polyline fill="none" stroke="black" points="421.922,-273.452 260.078,-273.452 "/>
|
||||
<polyline fill="none" stroke="black" points="421.922,-273.452 421.922,-241.452 "/>
|
||||
<polyline fill="none" stroke="black" points="421.922,-273.452 425.922,-277.452 "/>
|
||||
<text text-anchor="middle" x="343" y="-253.452" font-family="Times,serif" font-size="20.00">ocr_tesseract_hocr</text>
|
||||
</g>
|
||||
<!-- t4->t5 -->
|
||||
<g id="edge8" class="edge"><title>t4->t5</title>
|
||||
<path fill="none" stroke="#0044a0" d="M356.891,-299.346C355.495,-295.438 353.979,-291.194 352.48,-286.995"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="355.731,-285.694 349.072,-277.453 349.139,-288.048 355.731,-285.694"/>
|
||||
<path fill="none" stroke="#0044a0" d="M425.139,-478.007C437.834,-470.731 450.731,-461.83 461,-451.452 473.874,-438.442 466.946,-427.178 481,-415.452 490.212,-407.766 513.965,-399.205 537.508,-392.067"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="538.592,-395.396 547.189,-389.203 536.607,-388.683 538.592,-395.396"/>
|
||||
</g>
|
||||
<!-- t9 -->
|
||||
<g id="node11" class="node"><title>t9</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="292.496,-219.452 39.5039,-219.452 35.5039,-215.452 35.5039,-183.452 288.496,-183.452 292.496,-187.452 292.496,-219.452"/>
|
||||
<polyline fill="none" stroke="black" points="288.496,-215.452 35.5039,-215.452 "/>
|
||||
<polyline fill="none" stroke="black" points="288.496,-215.452 288.496,-183.452 "/>
|
||||
<polyline fill="none" stroke="black" points="288.496,-215.452 292.496,-219.452 "/>
|
||||
<text text-anchor="middle" x="164" y="-195.452" font-family="Times,serif" font-size="20.00">tesseract_ocr_and_render_pdf</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="272.496,-277.452 19.5039,-277.452 15.5039,-273.452 15.5039,-241.452 268.496,-241.452 272.496,-245.452 272.496,-277.452"/>
|
||||
<polyline fill="none" stroke="black" points="268.496,-273.452 15.5039,-273.452 "/>
|
||||
<polyline fill="none" stroke="black" points="268.496,-273.452 268.496,-241.452 "/>
|
||||
<polyline fill="none" stroke="black" points="268.496,-273.452 272.496,-277.452 "/>
|
||||
<text text-anchor="middle" x="144" y="-253.452" font-family="Times,serif" font-size="20.00">tesseract_ocr_and_render_pdf</text>
|
||||
</g>
|
||||
<!-- t1->t9 -->
|
||||
<g id="edge15" class="edge"><title>t1->t9</title>
|
||||
<path fill="none" stroke="#0044a0" d="M277.341,-486.044C254.708,-478.702 232.21,-467.759 215,-451.452 168.207,-407.114 152.056,-329.127 146.633,-287.855"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="150.084,-287.235 145.422,-277.721 143.133,-288.065 150.084,-287.235"/>
|
||||
</g>
|
||||
<!-- t3 -->
|
||||
<g id="node4" class="node"><title>t3</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="458.999,-393.452 291.001,-393.452 287.001,-389.452 287.001,-357.452 454.999,-357.452 458.999,-361.452 458.999,-393.452"/>
|
||||
<polyline fill="none" stroke="black" points="454.999,-389.452 287.001,-389.452 "/>
|
||||
<polyline fill="none" stroke="black" points="454.999,-389.452 454.999,-357.452 "/>
|
||||
<polyline fill="none" stroke="black" points="454.999,-389.452 458.999,-393.452 "/>
|
||||
<text text-anchor="middle" x="373" y="-369.452" font-family="Times,serif" font-size="20.00">preprocess_deskew</text>
|
||||
</g>
|
||||
<!-- t2->t3 -->
|
||||
<g id="edge3" class="edge"><title>t2->t3</title>
|
||||
<path fill="none" stroke="#0044a0" d="M348.691,-415.346C351.337,-411.112 354.23,-406.485 357.066,-401.946"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="360.042,-403.788 362.374,-393.453 354.106,-400.078 360.042,-403.788"/>
|
||||
</g>
|
||||
<!-- t6 -->
|
||||
<g id="node6" class="node"><title>t6</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="664.375,-277.452 477.625,-277.452 473.625,-273.452 473.625,-241.452 660.375,-241.452 664.375,-245.452 664.375,-277.452"/>
|
||||
<polyline fill="none" stroke="black" points="660.375,-273.452 473.625,-273.452 "/>
|
||||
<polyline fill="none" stroke="black" points="660.375,-273.452 660.375,-241.452 "/>
|
||||
<polyline fill="none" stroke="black" points="660.375,-273.452 664.375,-277.452 "/>
|
||||
<text text-anchor="middle" x="569" y="-253.452" font-family="Times,serif" font-size="20.00">select_image_for_pdf</text>
|
||||
</g>
|
||||
<!-- t2->t6 -->
|
||||
<g id="edge7" class="edge"><title>t2->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M423.032,-415.374C438.812,-409.925 454.543,-402.785 468,-393.452 508.201,-365.571 539.287,-316.662 555.808,-286.558"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="559.024,-287.965 560.653,-277.496 552.851,-284.664 559.024,-287.965"/>
|
||||
</g>
|
||||
<!-- t4 -->
|
||||
<g id="node5" class="node"><title>t4</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="449.705,-335.452 300.295,-335.452 296.295,-331.452 296.295,-299.452 445.705,-299.452 449.705,-303.452 449.705,-335.452"/>
|
||||
<polyline fill="none" stroke="black" points="445.705,-331.452 296.295,-331.452 "/>
|
||||
<polyline fill="none" stroke="black" points="445.705,-331.452 445.705,-299.452 "/>
|
||||
<polyline fill="none" stroke="black" points="445.705,-331.452 449.705,-335.452 "/>
|
||||
<text text-anchor="middle" x="373" y="-311.452" font-family="Times,serif" font-size="20.00">preprocess_clean</text>
|
||||
</g>
|
||||
<!-- t3->t4 -->
|
||||
<g id="edge4" class="edge"><title>t3->t4</title>
|
||||
<path fill="none" stroke="#0044a0" d="M373,-357.346C373,-353.655 373,-349.665 373,-345.695"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="376.5,-345.453 373,-335.453 369.5,-345.453 376.5,-345.453"/>
|
||||
</g>
|
||||
<!-- t3->t6 -->
|
||||
<g id="edge6" class="edge"><title>t3->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M414.399,-357.412C428.785,-351.039 444.852,-343.405 459,-335.452 466.909,-331.007 506.49,-303.805 535.921,-283.431"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="538.073,-286.198 544.299,-277.625 534.086,-280.444 538.073,-286.198"/>
|
||||
</g>
|
||||
<!-- t4->t6 -->
|
||||
<g id="edge5" class="edge"><title>t4->t6</title>
|
||||
<path fill="none" stroke="#0044a0" d="M432.605,-299.422C453.701,-293.395 477.617,-286.561 499.465,-280.319"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="500.687,-283.61 509.341,-277.497 498.764,-276.879 500.687,-283.61"/>
|
||||
</g>
|
||||
<!-- t5 -->
|
||||
<g id="node7" class="node"><title>t5</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="455.922,-277.452 294.078,-277.452 290.078,-273.452 290.078,-241.452 451.922,-241.452 455.922,-245.452 455.922,-277.452"/>
|
||||
<polyline fill="none" stroke="black" points="451.922,-273.452 290.078,-273.452 "/>
|
||||
<polyline fill="none" stroke="black" points="451.922,-273.452 451.922,-241.452 "/>
|
||||
<polyline fill="none" stroke="black" points="451.922,-273.452 455.922,-277.452 "/>
|
||||
<text text-anchor="middle" x="373" y="-253.452" font-family="Times,serif" font-size="20.00">ocr_tesseract_hocr</text>
|
||||
</g>
|
||||
<!-- t4->t5 -->
|
||||
<g id="edge8" class="edge"><title>t4->t5</title>
|
||||
<path fill="none" stroke="#0044a0" d="M373,-299.346C373,-295.655 373,-291.665 373,-287.695"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="376.5,-287.453 373,-277.453 369.5,-287.453 376.5,-287.453"/>
|
||||
</g>
|
||||
<!-- t4->t9 -->
|
||||
<g id="edge14" class="edge"><title>t4->t9</title>
|
||||
<path fill="none" stroke="#0044a0" d="M300.717,-299.405C284.01,-293.605 266.338,-286.3 251,-277.452 227.033,-263.625 203.489,-242.755 186.95,-226.538"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="189.414,-224.052 179.868,-219.456 184.465,-229.002 189.414,-224.052"/>
|
||||
<path fill="none" stroke="#0044a0" d="M303.36,-299.422C278.157,-293.259 249.509,-286.253 223.521,-279.898"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="224.249,-276.473 213.704,-277.497 222.586,-283.273 224.249,-276.473"/>
|
||||
</g>
|
||||
<!-- t7 -->
|
||||
<g id="node8" class="node"><title>t7</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="708.366,-219.452 551.634,-219.452 547.634,-215.452 547.634,-183.452 704.366,-183.452 708.366,-187.452 708.366,-219.452"/>
|
||||
<polyline fill="none" stroke="black" points="704.366,-215.452 547.634,-215.452 "/>
|
||||
<polyline fill="none" stroke="black" points="704.366,-215.452 704.366,-183.452 "/>
|
||||
<polyline fill="none" stroke="black" points="704.366,-215.452 708.366,-219.452 "/>
|
||||
<text text-anchor="middle" x="628" y="-195.452" font-family="Times,serif" font-size="20.00">render_hocr_page</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="426.366,-219.452 269.634,-219.452 265.634,-215.452 265.634,-183.452 422.366,-183.452 426.366,-187.452 426.366,-219.452"/>
|
||||
<polyline fill="none" stroke="black" points="422.366,-215.452 265.634,-215.452 "/>
|
||||
<polyline fill="none" stroke="black" points="422.366,-215.452 422.366,-183.452 "/>
|
||||
<polyline fill="none" stroke="black" points="422.366,-215.452 426.366,-219.452 "/>
|
||||
<text text-anchor="middle" x="346" y="-195.452" font-family="Times,serif" font-size="20.00">render_hocr_page</text>
|
||||
</g>
|
||||
<!-- t6->t7 -->
|
||||
<g id="edge9" class="edge"><title>t6->t7</title>
|
||||
<path fill="none" stroke="#0044a0" d="M566.187,-241.346C574.468,-236.135 583.697,-230.328 592.445,-224.824"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="594.38,-227.741 600.98,-219.453 590.652,-221.817 594.38,-227.741"/>
|
||||
<path fill="none" stroke="#0044a0" d="M501.184,-241.422C476.75,-235.286 448.99,-228.315 423.772,-221.982"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="424.429,-218.538 413.877,-219.497 422.724,-225.328 424.429,-218.538"/>
|
||||
</g>
|
||||
<!-- t8 -->
|
||||
<g id="node9" class="node"><title>t8</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="529.742,-219.452 314.258,-219.452 310.258,-215.452 310.258,-183.452 525.742,-183.452 529.742,-187.452 529.742,-219.452"/>
|
||||
<polyline fill="none" stroke="black" points="525.742,-215.452 310.258,-215.452 "/>
|
||||
<polyline fill="none" stroke="black" points="525.742,-215.452 525.742,-183.452 "/>
|
||||
<polyline fill="none" stroke="black" points="525.742,-215.452 529.742,-219.452 "/>
|
||||
<text text-anchor="middle" x="420" y="-195.452" font-family="Times,serif" font-size="20.00">render_hocr_debug_page</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="663.742,-219.452 448.258,-219.452 444.258,-215.452 444.258,-183.452 659.742,-183.452 663.742,-187.452 663.742,-219.452"/>
|
||||
<polyline fill="none" stroke="black" points="659.742,-215.452 444.258,-215.452 "/>
|
||||
<polyline fill="none" stroke="black" points="659.742,-215.452 659.742,-183.452 "/>
|
||||
<polyline fill="none" stroke="black" points="659.742,-215.452 663.742,-219.452 "/>
|
||||
<text text-anchor="middle" x="554" y="-195.452" font-family="Times,serif" font-size="20.00">render_hocr_debug_page</text>
|
||||
</g>
|
||||
<!-- t6->t8 -->
|
||||
<g id="edge11" class="edge"><title>t6->t8</title>
|
||||
<path fill="none" stroke="#0044a0" d="M502.649,-241.346C490.885,-235.809 477.689,-229.6 465.354,-223.795"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="466.666,-220.544 456.128,-219.453 463.686,-226.878 466.666,-220.544"/>
|
||||
<path fill="none" stroke="#0044a0" d="M564.418,-241.346C563.4,-237.546 562.298,-233.43 561.203,-229.345"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="564.522,-228.207 558.554,-219.453 557.761,-230.018 564.522,-228.207"/>
|
||||
</g>
|
||||
<!-- t5->t7 -->
|
||||
<g id="edge10" class="edge"><title>t5->t7</title>
|
||||
<path fill="none" stroke="#0044a0" d="M426.2,-242.104C461.192,-235.228 501.99,-227.212 537.71,-220.193"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="538.503,-223.604 547.641,-218.242 537.154,-216.736 538.503,-223.604"/>
|
||||
<path fill="none" stroke="#0044a0" d="M364.752,-241.346C362.816,-237.329 360.708,-232.958 358.629,-228.645"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="361.693,-226.941 354.197,-219.453 355.387,-229.981 361.693,-226.941"/>
|
||||
</g>
|
||||
<!-- t5->t8 -->
|
||||
<g id="edge12" class="edge"><title>t5->t8</title>
|
||||
<path fill="none" stroke="#0044a0" d="M366.521,-241.346C373.387,-236.352 381.007,-230.811 388.291,-225.513"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="390.594,-228.166 396.623,-219.453 386.477,-222.504 390.594,-228.166"/>
|
||||
<path fill="none" stroke="#0044a0" d="M428.289,-241.346C447.587,-235.375 469.416,-228.622 489.404,-222.437"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="490.53,-225.753 499.049,-219.453 488.461,-219.065 490.53,-225.753"/>
|
||||
</g>
|
||||
<!-- t12 -->
|
||||
<g id="node13" class="node"><title>t12</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="339.845,-105.456 420,-78.0208 500.155,-105.456 500.08,-149.848 339.92,-149.848 339.845,-105.456"/>
|
||||
<polygon fill="none" stroke="black" points="335.836,-102.581 420,-73.7729 504.164,-102.581 504.078,-153.869 335.922,-153.869 335.836,-102.581"/>
|
||||
<text text-anchor="middle" x="420" y="-111.726" font-family="Times,serif" font-size="20.00">merge_pages</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="473.845,-105.456 554,-78.0208 634.155,-105.456 634.08,-149.848 473.92,-149.848 473.845,-105.456"/>
|
||||
<polygon fill="none" stroke="black" points="469.836,-102.581 554,-73.7729 638.164,-102.581 638.078,-153.869 469.922,-153.869 469.836,-102.581"/>
|
||||
<text text-anchor="middle" x="554" y="-111.726" font-family="Times,serif" font-size="20.00">merge_pages</text>
|
||||
</g>
|
||||
<!-- t7->t12 -->
|
||||
<g id="edge19" class="edge"><title>t7->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M584.65,-183.419C564.063,-175.33 538.602,-165.326 513.908,-155.624"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="515.081,-152.324 504.493,-151.924 512.521,-158.839 515.081,-152.324"/>
|
||||
<g id="edge20" class="edge"><title>t7->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M389.35,-183.419C409.937,-175.33 435.398,-165.326 460.092,-155.624"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="461.479,-158.839 469.507,-151.924 458.919,-152.324 461.479,-158.839"/>
|
||||
</g>
|
||||
<!-- t8->t12 -->
|
||||
<g id="edge18" class="edge"><title>t8->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M420,-183.12C420,-177.585 420,-171.177 420,-164.592"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="423.5,-164.201 420,-154.201 416.5,-164.201 423.5,-164.201"/>
|
||||
<g id="edge19" class="edge"><title>t8->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M554,-183.12C554,-177.585 554,-171.177 554,-164.592"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="557.5,-164.201 554,-154.201 550.5,-164.201 557.5,-164.201"/>
|
||||
</g>
|
||||
<!-- t11->t12 -->
|
||||
<g id="edge16" class="edge"><title>t11->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M92.3128,-357.362C55.4572,-321.636 -19.1794,-237.859 27,-183.452 64.5123,-139.256 221.468,-125.188 325.317,-120.741"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="325.658,-124.23 335.508,-120.328 325.375,-117.236 325.658,-124.23"/>
|
||||
<g id="edge17" class="edge"><title>t11->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M615.939,-357.13C634.767,-339.333 661.745,-309.733 673,-277.452 686.754,-238.003 694.347,-219.364 673,-183.452 666.345,-172.256 656.999,-162.875 646.44,-155.047"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="648.378,-152.132 638.152,-149.36 644.417,-157.904 648.378,-152.132"/>
|
||||
</g>
|
||||
<!-- t9->t12 -->
|
||||
<g id="edge17" class="edge"><title>t9->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M217.354,-183.419C248.764,-173.392 289.391,-160.422 326.012,-148.731"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="327.263,-152.006 335.725,-145.63 325.134,-145.337 327.263,-152.006"/>
|
||||
<g id="edge18" class="edge"><title>t9->t12</title>
|
||||
<path fill="none" stroke="#0044a0" d="M164.711,-241.235C186.394,-224.08 222.088,-198.224 257,-183.452 321.895,-155.994 399.893,-139.571 459.67,-130.141"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="460.504,-133.554 469.855,-128.574 459.439,-126.635 460.504,-133.554"/>
|
||||
</g>
|
||||
<!-- t10->t12 -->
|
||||
<g id="edge21" class="edge"><title>t10->t12</title>
|
||||
<path fill="none" stroke="gray" d="M653.379,-415.337C684.552,-396.255 727,-362.233 727,-318.452 727,-318.452 727,-318.452 727,-258.452 727,-224.824 739.784,-208.186 717,-183.452 689.882,-154.013 590.624,-136.736 514.239,-127.544"/>
|
||||
<polygon fill="gray" stroke="gray" points="514.437,-124.044 504.097,-126.355 513.621,-130.996 514.437,-124.044"/>
|
||||
<g id="edge22" class="edge"><title>t10->t12</title>
|
||||
<path fill="none" stroke="gray" d="M629.379,-415.337C660.552,-396.255 703,-362.233 703,-318.452 703,-318.452 703,-318.452 703,-258.452 703,-224.066 705.581,-210.223 684,-183.452 673.976,-171.017 660.952,-160.773 647.026,-152.396"/>
|
||||
<polygon fill="gray" stroke="gray" points="648.682,-149.312 638.258,-147.419 645.227,-155.4 648.682,-149.312"/>
|
||||
</g>
|
||||
<!-- t13 -->
|
||||
<g id="node14" class="node"><title>t13</title>
|
||||
<polygon fill="#efa03b" stroke="black" points="482.338,-52 361.662,-52 357.662,-48 357.662,-16 478.338,-16 482.338,-20 482.338,-52"/>
|
||||
<polyline fill="none" stroke="black" points="478.338,-48 357.662,-48 "/>
|
||||
<polyline fill="none" stroke="black" points="478.338,-48 478.338,-16 "/>
|
||||
<polyline fill="none" stroke="black" points="478.338,-48 482.338,-52 "/>
|
||||
<text text-anchor="middle" x="420" y="-28" font-family="Times,serif" font-size="20.00">validate_pdfa</text>
|
||||
<polygon fill="#efa03b" stroke="black" points="616.338,-52 495.662,-52 491.662,-48 491.662,-16 612.338,-16 616.338,-20 616.338,-52"/>
|
||||
<polyline fill="none" stroke="black" points="612.338,-48 491.662,-48 "/>
|
||||
<polyline fill="none" stroke="black" points="612.338,-48 612.338,-16 "/>
|
||||
<polyline fill="none" stroke="black" points="612.338,-48 616.338,-52 "/>
|
||||
<text text-anchor="middle" x="554" y="-28" font-family="Times,serif" font-size="20.00">validate_pdfa</text>
|
||||
</g>
|
||||
<!-- t12->t13 -->
|
||||
<g id="edge20" class="edge"><title>t12->t13</title>
|
||||
<path fill="none" stroke="#0044a0" d="M420,-73.9482C420,-69.9654 420,-66.007 420,-62.2247"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="423.5,-62.1573 420,-52.1573 416.5,-62.1574 423.5,-62.1573"/>
|
||||
<g id="edge21" class="edge"><title>t12->t13</title>
|
||||
<path fill="none" stroke="#0044a0" d="M554,-73.9482C554,-69.9654 554,-66.007 554,-62.2247"/>
|
||||
<polygon fill="#0044a0" stroke="#0044a0" points="557.5,-62.1573 554,-52.1573 550.5,-62.1574 557.5,-62.1573"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
@@ -134,3 +134,13 @@ def test_force_ocr():
|
||||
|
||||
def test_skip_ocr():
|
||||
check_ocrmypdf('graph_ocred.pdf', 'test_skip.pdf', '-s')
|
||||
|
||||
|
||||
def check_ocr_timeout(renderer):
|
||||
check_ocrmypdf('skew.pdf', 'test_timeout_%s.pdf' % renderer,
|
||||
'--tesseract-timeout', '1.0')
|
||||
|
||||
|
||||
def test_ocr_timeout():
|
||||
yield check_ocr_timeout, 'hocr'
|
||||
yield check_ocr_timeout, 'tesseract'
|
||||
|
||||
Reference in New Issue
Block a user