Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb87aa2a

Browse files
authored
fix#131 (#132)
*fix#131* more comments
1 parent1a9b586 commitb87aa2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/layoutparser/visualization.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def draw_box(
318318
font_obj=_create_font_object(id_font_size,id_font_path)
319319

320320
ifbox_alphaisNone:
321-
box_alpha= [0]
321+
box_alpha= [0]*len(layout)
322322
else:
323323
ifisinstance(box_alpha, (float,int)):
324324
box_alpha= [box_alpha]*len(layout)
@@ -363,6 +363,11 @@ def draw_box(
363363
f"The number of colors{len(box_color)} is not equal to the number of blocks{len(layout)}"
364364
)
365365

366+
# A post check of the lengths of the input lists
367+
# To support more versions of python, we do not use
368+
# zip(*, strict=True)
369+
assertlen(layout)==len(box_color)==len(box_alpha)==len(box_width)
370+
366371
foridx, (ele,color,alpha,width)inenumerate(
367372
zip(layout,box_color,box_alpha,box_width)
368373
):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp