Skip to content

Commit fe6a476

Browse files
authored
feat: Add arguments for LayoutPredictor (#66)
Signed-off-by: Christoph Auer <[email protected]>
1 parent caf8b80 commit fe6a476

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docling_ibm_models/layoutmodel/layout_predictor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
import os
77
from collections.abc import Iterable
8-
from typing import Union
8+
from typing import Set, Union
99

1010
import numpy as np
1111
import torch
@@ -26,6 +26,8 @@ def __init__(
2626
artifact_path: str,
2727
device: str = "cpu",
2828
num_threads: int = 4,
29+
base_threshold: float = 0.3,
30+
blacklist_classes: Set[str] = set(),
2931
):
3032
"""
3133
Provide the artifact path that contains the LayoutModel file
@@ -63,10 +65,10 @@ def __init__(
6365
}
6466

6567
# Blacklisted classes
66-
self._black_classes = set() # ["Form", "Key-Value Region"])
68+
self._black_classes = blacklist_classes # set(["Form", "Key-Value Region"])
6769

6870
# Set basic params
69-
self._threshold = 0.3 # Score threshold
71+
self._threshold = base_threshold # Score threshold
7072
self._image_size = 640
7173
self._size = np.asarray([[self._image_size, self._image_size]], dtype=np.int64)
7274

0 commit comments

Comments
 (0)