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

Shift in the results #14

Open
lelapin123 opened this issue Mar 28, 2023 · 0 comments
Open

Shift in the results #14

lelapin123 opened this issue Mar 28, 2023 · 0 comments

Comments

@lelapin123
Copy link

lelapin123 commented Mar 28, 2023

I tried to use this code:
https://github.com/tulasiram58827/ocr_tflite/blob/main/colabs/captcha_ocr_tflite.ipynb

I had to convert it to py to make it work.
Now it is able to guess letters, but they get scrambled.

To fix this i change this line:
characters = set(char for label in labels for char in label)
with this line:
characters = (sorted(set(char for label in labels for char in label)))

Now, when there is a 3 on the picture, 2 is detected,
4 is 3
5 is 4
8 is 7
b is 8,

There is always a shift of one, but beside converting the string from one to the other, i am not able to make the code work.

What worked was to change: num_oov_indices=0
to num_oov_indices=1

But then, i am not able to train the model anymore.
I wonder is there is not a problem in the background.

It seems like these lines:
preds = prediction_model.predict(batch_images)
pred_texts = decode_batch_predictions(preds)

Always return a result that is shifted from the real answer.

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

No branches or pull requests

1 participant