Fix chars_in_rect pairing top-down rects with top/bottom - #5096
Fix chars_in_rect pairing top-down rects with top/bottom#5096BetterAndBetterII wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
Thanks for the fix! I also tested this against our 503-page table benchmark. Looking at those pages individually, one improved significantly, one regression appears to be a ground-truth mismatch, and the remaining two exposed pre-existing edge cases in the refine pipeline that were previously masked because these candidates were being rejected. So I don't think the small benchmark regression is a reason to hold this fix. |
|
@JorjMcKie We may run into this more often with agent-assisted PRs, so I think it would be worth deciding how we want to handle agent accounts in the CLA process going forward. |
|
There's a cla-assistant issue for this: cla-assistant/cla-assistant#1190, but it only has two comments (including my new one). |
Pair top-down rects with character top/bottom, matching has_text().
71956cc to
a0dd7cf
Compare
Summary
chars_in_rect()compared a top-downrect(rect[1]top,rect[3]bottom) against CTMy0/y1. Short tables and non-identity CTMs then failed the text-in-rect check and were dropped fromfind_tables().rect[1]/rect[3]withc["top"]/c["bottom"], matchinghas_text()in the same file.pymupdf.table.chars_in_rect()drops table candidates and rows #5092Test plan
top/bottominsiderectandy0/y1outside is now detectedtests/test_tables.py—test_5092andtest_table2passed