Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
Apache License 2.0
1.04k stars 209 forks source link

Prediction from calamari trained .pb model #333

Closed rajban94 closed 1 year ago

rajban94 commented 1 year ago

I have a .pb model which is trained on a dataset. But unable to predict the data from the image using that .pb model. It will be very helpful if i will get any assistance for the same.

andbue commented 1 year ago

It seems you're using an experimental version, the default calamari saves its models as .ckpt.json and .ckpt.h5. Please have a look at the docs (https://calamari-ocr.readthedocs.io/en/latest/doc.command-line-usage.html#calamari-predict) and try providing the /path/to/the/model/without/pb/ending/model.ckpt!

rajban94 commented 1 year ago

Yes i was using an experimental version but now i am using .ckpt.h5 and .ckpt.json but i don't want to use (https://calamari-ocr.readthedocs.io/en/latest/doc.command-line-usage.html#calamari-predict) Is there any way to predict the data and instead of writting it in the .txt file it will show as a string i have already tried the predict_raw from the documentation. If i will get the code that will be helpful.

andbue commented 1 year ago

You can find some documentation for the Predictor object in the docs (https://calamari-ocr.readthedocs.io/en/latest/doc.predicting.html#python-api) and also, as mentioned there, in https://github.com/Calamari-OCR/calamari/blob/master/calamari_ocr/test/test_prediction.py.

rajban94 commented 1 year ago

The first link already i have tried but getting error for tfaip loggings broken pipeline. I will test the second approach and will let you know. Thanks for your help.

rajban94 commented 1 year ago

Thanks finally it worked for me thanks for the help.