Skip to content

Commit

Permalink
Add arguments for LayoutPredictor
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Auer <[email protected]>
  • Loading branch information
cau-git committed Dec 13, 2024
1 parent caf8b80 commit b70c3b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docling_ibm_models/layoutmodel/layout_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import os
from collections.abc import Iterable
from typing import Union
from typing import Set, Union

import numpy as np
import torch
Expand All @@ -26,6 +26,8 @@ def __init__(
artifact_path: str,
device: str = "cpu",
num_threads: int = 4,
base_treshold: float = 0.3,
blacklist_classes: Set[str] = set(),
):
"""
Provide the artifact path that contains the LayoutModel file
Expand Down Expand Up @@ -63,10 +65,10 @@ def __init__(
}

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

# Set basic params
self._threshold = 0.3 # Score threshold
self._threshold = base_treshold # Score threshold
self._image_size = 640
self._size = np.asarray([[self._image_size, self._image_size]], dtype=np.int64)

Expand Down

0 comments on commit b70c3b2

Please sign in to comment.