Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiPredictor.predict_raw: pass on batch_size, too #361

Merged

Conversation

bertsky
Copy link
Collaborator

@bertsky bertsky commented Sep 17, 2024

This has been overlooked. When using MultiPredictor.predict_raw in C1, you had to do a workaround (like itertools.batched) to prevent OOM. This just passes on the batch_size kwarg to Predictor.predict_raw.

@bertsky
Copy link
Collaborator Author

bertsky commented Sep 27, 2024

What is still lacking in Calamari 1 is batch size bucketing as provided by TF2/tfaip in Calamari 2. It's easy to get OOM if the batch includes images with a large width (esp. if they also have low height and thus have to be scaled up for target height), due to zero padding. In those cases, the batch should be split up...

@bertsky bertsky merged commit eec492c into Calamari-OCR:calamari/1.0 Oct 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant