461bf6fd40
CI / lint (3.11) (push) Has been cancelled
CI / lint (3.12) (push) Has been cancelled
CI / lint (3.13) (push) Has been cancelled
CI / shellcheck (push) Has been cancelled
CI / shfmt (push) Has been cancelled
CI / setup (3.11) (push) Has been cancelled
CI / setup (3.12) (push) Has been cancelled
CI / setup (3.13) (push) Has been cancelled
CI / check-licenses (3.12) (push) Has been cancelled
CI / test_unit (3.11) (push) Has been cancelled
CI / test_unit (3.12) (push) Has been cancelled
CI / test_unit (3.13) (push) Has been cancelled
CI / test_unit_no_extras (3.11) (push) Has been cancelled
CI / test_unit_no_extras (3.12) (push) Has been cancelled
CI / test_json_to_html (3.12) (push) Has been cancelled
CI / test_unit_no_extras (3.13) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.12, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.11, --extra xlsx) (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.12, --extra xlsx) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.11, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (csv, 3.13, --extra csv) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.11, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.12, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (docx, 3.13, --extra docx) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.11, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.12, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (markdown, 3.13, --extra md) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.11, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.12, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (odt, 3.13, --extra odt) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.11, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.12, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pdf-image, 3.13, --extra pdf --extra image --extra paddleocr) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.11, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.12, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pptx, 3.13, --extra pptx) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.11, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.12, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
CI / test_unit_dependency_extras (pypandoc, 3.13, --extra epub --extra org --extra rtf --extra rst) (push) Has been cancelled
Build And Push Docker Image / set-short-sha (push) Has been cancelled
Partition Benchmark / setup (push) Has been cancelled
Partition Benchmark / Measure and compare partition() runtime (push) Has been cancelled
CI / test_unit_dependency_extras (xlsx, 3.13, --extra xlsx) (push) Has been cancelled
CI / test_ingest_src (3.12) (push) Has been cancelled
CI / test_json_to_markdown (3.12) (push) Has been cancelled
CI / changelog (push) Has been cancelled
CI / test_dockerfile (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build And Push Docker Image / build-images (linux/amd64, opensource-linux-8core) (push) Has been cancelled
Build And Push Docker Image / build-images (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build And Push Docker Image / publish-images (push) Has been cancelled
79 lines
2.2 KiB
Python
79 lines
2.2 KiB
Python
import pytest
|
|
from unstructured_inference.inference.elements import EmbeddedTextRegion
|
|
|
|
|
|
@pytest.fixture()
|
|
def mock_embedded_text_regions():
|
|
return [
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=453.00277777777774,
|
|
y1=317.319341111111,
|
|
x2=711.5338541666665,
|
|
y2=358.28571222222206,
|
|
text="LayoutParser:",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=726.4778125,
|
|
y1=317.319341111111,
|
|
x2=760.3308594444444,
|
|
y2=357.1698966666667,
|
|
text="A",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=775.2748177777777,
|
|
y1=317.319341111111,
|
|
x2=917.3579885555555,
|
|
y2=357.1698966666667,
|
|
text="Unified",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=932.3019468888888,
|
|
y1=317.319341111111,
|
|
x2=1071.8426522222221,
|
|
y2=357.1698966666667,
|
|
text="Toolkit",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=1086.7866105555556,
|
|
y1=317.319341111111,
|
|
x2=1141.2105142777777,
|
|
y2=357.1698966666667,
|
|
text="for",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=1156.154472611111,
|
|
y1=317.319341111111,
|
|
x2=1256.334784222222,
|
|
y2=357.1698966666667,
|
|
text="Deep",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=437.83888888888885,
|
|
y1=367.13322999999986,
|
|
x2=610.0171992222222,
|
|
y2=406.9837855555556,
|
|
text="Learning",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=624.9611575555555,
|
|
y1=367.13322999999986,
|
|
x2=741.6754646666665,
|
|
y2=406.9837855555556,
|
|
text="Based",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=756.619423,
|
|
y1=367.13322999999986,
|
|
x2=958.3867708333332,
|
|
y2=406.9837855555556,
|
|
text="Document",
|
|
),
|
|
EmbeddedTextRegion.from_coords(
|
|
x1=973.3307291666665,
|
|
y1=367.13322999999986,
|
|
x2=1092.0535042777776,
|
|
y2=406.9837855555556,
|
|
text="Image",
|
|
),
|
|
]
|