doc-analysis / TableBank

TableBank: A Benchmark Dataset for Table Detection and Recognition
Apache License 2.0
987 stars 139 forks source link

TestPretrainedModel.md detectron2 #26

Open kbrajwani opened 3 years ago

kbrajwani commented 3 years ago

please make TestPretrainedModel.md as per detectron2 and i think you have upload the weights of detectron2 with detectron1 config. correct me if i am worng.

liminghao1630 commented 3 years ago

Please refer to the detectron2 for inferring instructions. Which config do you think is detecton's?

kbrajwani commented 3 years ago

Hi thanks for reply Actually i am not friendlier with detectron so it can be wrong.

when i use you config All_X101.yaml and its load model from bucket it gives result. cfg = get_cfg() cfg.merge_from_file("/content/All_X101.yaml") cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model predictor = DefaultPredictor(cfg) outputs = predictor(im)

but when i use you config All_X101.yaml with model_final.pth its not gives any result. cfg = get_cfg() cfg.merge_from_file("/content/All_X101.yaml") cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 # set threshold for this model cfg.MODEL.WEIGHTS = "/content/model_final.pth" predictor = DefaultPredictor(cfg) outputs = predictor(im)

kbrajwani commented 3 years ago

i am running following notebook you can check results. https://colab.research.google.com/drive/1xeOQ5IUpwjDmCU6orwHd2hP3coOaau1t?usp=sharing

liminghao1630 commented 3 years ago

@kbrajwani Here is a copy of your notebook, which I modified to work well. https://colab.research.google.com/drive/1lmcdDNHjEia9l1-3SA4iTXAS1hF1_6X2?usp=sharing I notice that you comment the line "cfg.MODEL.WEIGHTS = '/content/model_final.pth'" which will make the predictor use the ImageNetPretrained model instead of our fine-tuned model. The ImageNetPretrained model has no knowledge about table detection.

kbrajwani commented 3 years ago

Thanks @liminghao1630 now i want to do table Recognition. so how can i use pretrained model.

kbrajwani commented 3 years ago

i read you have trained using OpenNMT. so can you please create readme about inference.

DuckJ commented 3 years ago

can you tell me detectron or detectron2 should be installed? According to the TestPretrainedModel.md, detectron should be installed, but the model provided from detectron2.

DuckJ commented 3 years ago

Did you forget to update the estPretrainedModel.md @liminghao1630

liminghao1630 commented 3 years ago

@DuckJ We have no plan to update the TestPretrainedModel.md for now, please refer to the detectron2 for inferring instructions.

DuckJ commented 3 years ago

@liminghao1630 .OK,Thanks, That's means I should install detectron2. right? TestPretrainedModel.md mislead me, I think you should add some information in it

liminghao1630 commented 3 years ago

@DuckJ Thanks for your suggestions. I have updated the TestPretrainedModel.md and add a reminder.

DuckJ commented 3 years ago

The detect model unzip error? should I use other tools? Archive: data.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central dire

DuckJ commented 3 years ago

@kbrajwani hi, which tools did you use to unzip the model.zip. I used the unzip and 7-zip, always failed

DuckJ commented 3 years ago

I I solved this problem by downloading each file separately. Thanks

alongadotvatbox commented 3 years ago

Hey @liminghao1630 , I'd like to run your pretrained models using the colab notebook you've modified for this issue: https://colab.research.google.com/drive/1lmcdDNHjEia9l1-3SA4iTXAS1hF1_6X2?usp=sharing It seems to fail on: predictor = DefaultPredictor(cfg) Due to UnpicklingError: invalid load key, '\x0d'. Would you perhaps know why & how to correct this behavior?

raghavnprasad commented 3 years ago

@alongadotvatbox did u find a solution for UnpicklingError: invalid load key, '\x0d'. ?

alongadotvatbox commented 3 years ago

No, just downloaded the dataset and trained from scratch using the pretrained detectron2 modules. Worked well, wasn't too much of a hassle.

On Mon, Jan 11, 2021 at 3:34 PM raghavnprasad notifications@github.com wrote:

@alongadotvatbox https://github.com/alongadotvatbox did u find a solution for UnpicklingError: invalid load key, '\x0d'. ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doc-analysis/TableBank/issues/26#issuecomment-757953970, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK6KEDYMW46JTMWXDGWEW6LSZL45NANCNFSM4RWYWNPQ .

--

Alon Gadot

Machine Learning Engineer

Mobile (IL): +972-52-4829831 Email: alon.gadot@vatbox.com

debparth commented 3 years ago

@alongadotvatbox If you don't mind then can you share the recognition model here?

omrastogi commented 2 years ago

@alongadotvatbox did u find a solution for UnpicklingError: invalid load key, '\x0d'. ?

The curl request is wrong and the downloaded file is wrongly uploaded. Where file size should've been more than 700MB, it was just 147KB. So something wrong there.