Skip to content

Commit 262ef0b

Browse files
authored
Minor fixes for typos and bugs (#58)
* change default value for extra_config * fix typo
1 parent 035f66a commit 262ef0b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/layoutparser/models/detectron2/layoutmodel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ def __init__(
5656
config_path,
5757
model_path=None,
5858
label_map=None,
59-
extra_config=[],
59+
extra_config=None,
6060
enforce_cpu=False,
6161
):
6262

63+
if extra_config is None:
64+
extra_config = []
65+
6366
if config_path.startswith("lp://") and label_map is None:
6467
dataset_name = config_path.lstrip("lp://").split("/")[0]
6568
label_map = LABEL_MAP_CATALOG[dataset_name]

src/layoutparser/models/paddledetection/layoutmodel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ def __init__(
9696
model_path=None,
9797
label_map=None,
9898
enforce_cpu=False,
99-
extra_config={},
99+
extra_config=None,
100100
):
101+
102+
if extra_config is None:
103+
extra_config = {}
104+
101105
if model_path is not None:
102106
model_dir = model_path
103107
elif config_path is not None and config_path.startswith(

src/layoutparser/visualization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def draw_box(
159159
Whether to display `block.id` on the top-left corner of
160160
the block.
161161
Defaults to False.
162-
show_element_id (bool, optional):
162+
show_element_type (bool, optional):
163163
Whether to display `block.type` on the top-left corner of
164164
the block.
165165
Defaults to False.

0 commit comments

Comments
 (0)