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

Mapping of cells output with actual inference image #163

Open
akshay-bothra opened this issue Dec 23, 2023 · 1 comment
Open

Mapping of cells output with actual inference image #163

akshay-bothra opened this issue Dec 23, 2023 · 1 comment

Comments

@akshay-bothra
Copy link

akshay-bothra commented Dec 23, 2023

Hi,
I am using inference for extracting cells objects. The output of detect is cropped and passed as an input to recognize. Now, recognize produces the cell objects for cropped table image. I want to map these cell bboxes on the actual image that was fed into the detection model. If you could provide some guidance on How should I map these to actual image input?

@mazeem-arbisoft
Copy link

mazeem-arbisoft commented Sep 23, 2024

You will need to resize the bboxes. You can use the following formulas:
old_width > size of your cropped image
new_width > size of your original page image (same goes for height)

new_xmin = int((xmin / old_width) * new_width)
new_ymin = int((ymin / old_height) * new_height)
new_xmax = int((xmax / old_width) * new_width)
new_ymax = int((ymax / old_height) * new_height)

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

2 participants