Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In what format are the coordinates of bounding boxes returned? #222

Open
Sopralapanca opened this issue Feb 25, 2025 · 0 comments
Open

In what format are the coordinates of bounding boxes returned? #222

Sopralapanca opened this issue Feb 25, 2025 · 0 comments

Comments

@Sopralapanca
Copy link

I am using layout-parser to detect bounding boxes related to tables in a pdf file.
When the coordinates are accessed in this way:

model = lp.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config', 
                                 extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8],
                                 label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})

# Detect tables
layout = model.detect(image_rgb)

for el in layout:
  coords = el.coordinates
  print(coords)

In what format are they returned? Could they be restitute in the format x1, y1, x2, y2 where (x1,y1) identifies the upper-left corner and (x2,y2) the lower-right corner and the origin of the coordinates is (0,0) in the lower-left corner?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant