From a4dc21395dde1df32aa2a7f854ba4561a8cf5869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Fri, 13 Dec 2024 13:46:25 -0300 Subject: [PATCH] blacklisted the picture layout tag so that it is forced to interpret the contents of the image and retrieve text that otherwise would be lost with an image tag --- docling/models/layout_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docling/models/layout_model.py b/docling/models/layout_model.py index 91897df4..4562b94a 100644 --- a/docling/models/layout_model.py +++ b/docling/models/layout_model.py @@ -48,6 +48,7 @@ class LayoutModel(BasePageModel): def __init__(self, artifacts_path: Path): self.layout_predictor = LayoutPredictor(artifacts_path) # TODO temporary + self.layout_predictor._black_classes.add("Picture") # Use this to disable picture recognition (trying to force to identify only text) def postprocess(self, clusters_in: List[Cluster], cells: List[Cell], page_height): MIN_INTERSECTION = 0.2