Closed lolipopshock closed 2 years ago
Not drawing the box outlines when setting box_width=0. For example,
box_width=0
from PIL import Image import layoutparser as lp image = Image.new('RGB', (50,50), color='white') lp.draw_box(image, [lp.Rectangle(10, 10, 40, 40)], box_width=0)
Previously, it will draw a box .
Allowing setting box_color in draw_box:
box_color
draw_box
directly setting box_color:
from PIL import Image import layoutparser as lp image = Image.new('RGB', (50,50), color='white') lp.draw_box(image, [lp.TextBlock(lp.Rectangle(10, 10, 20, 20), type='a'), lp.TextBlock(lp.Rectangle(30, 30, 45, 45), type='b'),] , box_color=['black', 'red'])
overriding color_map:
color_map
lp.draw_box(image, [lp.TextBlock(lp.Rectangle(10, 10, 20, 20), type='a'), lp.TextBlock(lp.Rectangle(30, 30, 45, 45), type='b'),] , color_map={'a':'black', 'b':'blue'}, box_color=['black', 'red'])
Setting box_color, box_alpha, and box_width for each objects:
box_alpha
box_width
from PIL import Image import layoutparser as lp image = Image.new('RGB', (50,50), color='white') lp.draw_box(image, [lp.TextBlock(lp.Rectangle(10, 10, 20, 20), type='a'), lp.TextBlock(lp.Rectangle(30, 30, 45, 45), type='b'),] , box_color=['black', 'red'], box_alpha=[0.1, 0.5], box_width=[2,4])
Not drawing the box outlines when setting
box_width=0
. For example,Previously, it will draw a box .
Allowing setting
box_color
indraw_box
:directly setting
box_color
:overriding
color_map
:Setting
box_color
,box_alpha
, andbox_width
for each objects: