mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-30 14:04:27 +00:00
fix: Refactor missing bbox attribute to PdfTextCell
Signed-off-by: hl2311 <dhlong2301@gmail.com>
This commit is contained in:
parent
448cbb2680
commit
8d453286a6
@ -63,7 +63,12 @@ class PagePreprocessingModel(BasePageModel):
|
||||
def draw_text_boxes(image, cells, show: bool = False):
|
||||
draw = ImageDraw.Draw(image)
|
||||
for c in cells:
|
||||
x0, y0, x1, y1 = c.to_bounding_box().l, c.to_bounding_box().t, c.to_bounding_box().r, c.to_bounding_box().b
|
||||
x0, y0, x1, y1 = (
|
||||
c.to_bounding_box().l,
|
||||
c.to_bounding_box().t,
|
||||
c.to_bounding_box().r,
|
||||
c.to_bounding_box().b,
|
||||
)
|
||||
draw.rectangle([(x0, y0), (x1, y1)], outline="red")
|
||||
if show:
|
||||
image.show()
|
||||
|
Loading…
Reference in New Issue
Block a user