You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can additionally run a layout detection model as part of the pipeline by passing `detect_layout=True`. The detected regions (e.g. `Title`, `Text`, `Table`, `Page-header`, `Page-footer`) are attached to every page and rendered by `.show()`:
65
+
66
+
```python
67
+
from doctr.io import DocumentFile
68
+
from doctr.models import ocr_predictor
69
+
70
+
model = ocr_predictor(pretrained=True, detect_layout=True)
Copy file name to clipboardExpand all lines: docs/source/modules/io.rst
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,13 @@ An Artefact is a non-textual element (e.g. QR code, picture, chart, signature, l
33
33
34
34
.. autoclass:: Artefact
35
35
36
+
LayoutElement
37
+
^^^^^^^^^^^^^
38
+
39
+
A LayoutElement is a region predicted by a layout detection model (e.g. Title, Text, Table, Page-header, Page-footer). Layout regions are attached to a :class:`Page` when the ``ocr_predictor`` / ``kie_predictor`` is run with ``detect_layout=True``.
40
+
41
+
.. autoclass:: LayoutElement
42
+
36
43
Block
37
44
^^^^^
38
45
A Block is a collection of Lines (e.g. an address written on several lines) and Artefacts (e.g. a graph with its title underneath).
0 commit comments