table-transformer icon indicating copy to clipboard operation
table-transformer copied to clipboard

BBox squezeed during inference.

Open sanjaychamlagain123 opened this issue 3 years ago • 5 comments

I tried inference in the images provided in your repo as well as other images.. It works perfectly for the samples provided by you but the bbox seems to squeeze in my samples. Screen Shot 2022-03-29 at 17 14 01

sanjaychamlagain123 avatar Mar 29 '22 11:03 sanjaychamlagain123

please can you tell me if there is Val data in thatPubTables1M-Structure-PASCAL-VOC/ folder,i don't have val and test data in the PubTables1M-Structure-PASCAL-VOC/

yang-chenyu104 avatar Apr 03 '22 16:04 yang-chenyu104

I tried inference in the images provided in your repo as well as other images.. It works perfectly for the samples provided by you but the bbox seems to squeeze in my samples. Screen Shot 2022-03-29 at 17 14 01

Can you please provide the code for inferencce?

fullpro avatar Apr 27 '22 10:04 fullpro

You can try image = cv2.copyMakeBorder(image, 40,40,40,40, cv2.BORDER_CONSTANT, None, value=(255,255,255)) to add a margin before passing into the model. The corresponding word bounding boxes also need to be shifted for the post-processing step. It works perfectly on new tables when I add a margin ~40px.

I believe it may be due to the model being trained with tables that have ~40px margin in the training dataset.

@bsmock is this a good hotfix for tightly bounded tables if utilize the pre-trained weights you provided?

finnthedawg avatar May 24 '22 09:05 finnthedawg

@finnthedawg, thanks a lot for this, it solved the squeezing issue for me

SamSamhuns avatar Jun 17 '22 07:06 SamSamhuns

Hi @sanjaychamlagain123 Can you please share your inference code? Thanks in advance!

zanvari avatar Oct 31 '22 23:10 zanvari