microsoft / table-transformer

Table Transformer (TATR) is a deep learning model for extracting tables from unstructured documents (PDFs and images). This is also the official repository for the PubTables-1M dataset and GriTS evaluation metric.
MIT License
2.01k stars 231 forks source link

ValueError: y1 must be greater than or equal to y0 #133

Open Anang1502 opened 10 months ago

Anang1502 commented 10 months ago

For one of the image, the table transformer structure model gives y0>y1 for row coordinates. This causes issues in further processing the table. What might be causing this issue?

bsmock commented 10 months ago

Hi,

Is this with one of the pre-trained models and one of the released datasets? If so can you share which model and which input image?

If not, is there any other information you can share so we can understand what caused this bug?

Best, Brandon

Shaobo-Zhao commented 5 months ago

did you solve this problem,bro?

Anang1502 commented 5 months ago

Hi @bsmock, Sorry for the late response on this. Yes, this issue occurred in the pre-trained model TATR-v1.1-Pub provided in the official repo. I was testing it on my data. This issue occurs when the pre-trained structure model gives y0 coordinate of the predicted table row greater than y1 and the code fails while running the assert statement for the same check.

Hi @Shaobo-Zhao, I didn't find any permanent solution for this but as a temporary fix, I assigned y0 = y1 wherever I encountered y0 > y1. This issue happens rarely for 1 or 2 images randomly and I could not find any specific pattern for this. But since the training fails even if it occurs for 1 image so I have applied this temporary fix for now.

Shaobo-Zhao commented 5 months ago

thank you ,my bro. i will try as you said.
best wishes to you.

Shaobo-Zhao commented 5 months ago

hi bro ,

guess what

installed pillow==8.3.1

the problem was solved.

nice