File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
docling_ibm_models/layoutmodel Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 55import logging
66import os
77from collections .abc import Iterable
8- from typing import Union
8+ from typing import Set , Union
99
1010import numpy as np
1111import 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
You can’t perform that action at this time.
0 commit comments