-
Notifications
You must be signed in to change notification settings - Fork 8
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
warning when trying to export recognition to onnx #31
Comments
This warning is quite normal in PyTorch codebases that haven't been updated very recently, as it was only added in PyTorch v2.4.0. Adding This warning shouldn't affect the accuracy of the output. I suspect something else is happening. Can you upload the model (in ONNX format) and a few examples of images it is trained to recognize? |
Sorry but I'm talking about this warning :
The training was good :
Here are some image extracted from the training (it's a synthetic dataset so nothing more to see) |
Did you modify the alphabet used for classification ( |
Oh yes I did
so how should I change it ? |
I tested this pull request that I made using the same alphabet I used for training, but I'm still getting incorrect characters during OCR. Am I missing something? or could there be an issue with the exported model, even though the training seemed to go well? let engine = OcrEngine::new(OcrEngineParams {
detection_model: Some(detection_model),
recognition_model: Some(recognition_model),
alphabet: Some(" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzéèà-%?".to_string()),
..Default::default()
})?; |
There might be an issue with the inputs being slightly different when using the ocrs library than what the model saw in training. You can export these inputs using |
I fine-tuned both of my models using additional images and made some modifications like adjusting font size, text offset, and tilt. While the text-detection model seems to work well, the recognition model isn't performing as expected. Below are the ONNX models and the image I tested them on. remybarranco@MacBook-Pro-de-Remy examples % cargo run -p ocrs-cli -r -- l.png --detect-model text-detection.rten
Finished `release` profile [optimized] target(s) in 0.03s
Running `/Users/remybarranco/Developer/ocrs-fork/target/release/ocrs l.png --detect-model text-detection.rten`
Alphabet: 0123456789?%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzéèà
251
21
41
7
7
7
7
401
7
7
remybarranco@MacBook-Pro-de-Remy examples % cargo run -p ocrs-cli -r -- l.png --detect-model text-detection.rten --rec-model text-recognition.rten
Finished `release` profile [optimized] target(s) in 0.03s
Running `/Users/remybarranco/Developer/ocrs-fork/target/release/ocrs l.png --detect-model text-detection.rten --rec-model text-recognition.rten`
Alphabet: 0123456789?%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzéèà
0 |
Hey, I'm getting this warning when exporting the text recognition, and I think it's causing the export to not work correctly. It seems like it's not exporting the last batch or something similar because the results are very poor when using it with your OCR library.
The text was updated successfully, but these errors were encountered: