Skip to content

Conversation

@RUTUPARNk
Copy link

🐞 Bug Fix: Handle UnboundLocalError in recognizer_predict

This patch ensures that preds_str and preds_max_prob are always initialized before use in recognizer_predict().

Previously, calling .readtext() on certain decoders (e.g., Tesseract or empty input) led to: UnboundLocalError: cannot access local variable 'preds_str'

Fixes #1415

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.

UnboundLocalError in recognizer_predict when preds_str not initialized

1 participant