-
Notifications
You must be signed in to change notification settings - Fork 171
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
Text recognition crnn #176
Conversation
4177989
to
ffa6beb
Compare
304ac99
to
b1c7531
Compare
@LaurentBerger Hi, thanks for contribution, this PR need to update readme document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!👍👍👍, here are something I think need to be modified.
# detect on camera input | ||
./build/opencv_zoo_text_recognition_crnn | ||
# detect on an image | ||
./build/opencv_zoo_text_recognition_crnn --input /path/to/image -v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to use -i=/path/to/image
or --input=/path/to/image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using -v
flag can't show the image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./build/opencv_zoo_text_recognition_crnn -v=0
show result as text but won't stop without ctrl+c. Must I add a counter to stop after 100 inferences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just be as consistent as possible with other demos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using -v flag can't show the image
Just modify the doc here to make sure the commands work. It does not worth making 100% same behavior as Python demos.
|
||
```shell | ||
# detect on camera input | ||
./build/opencv_zoo_text_recognition_crnn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this command can't recognize from camera.
./build/opencv_zoo_text_recognition_crnn --model=text_recognition_CRNN_CN_2021nov.onnx --charset=charset_3944_CN.txt | ||
# detect on an image | ||
./build/opencv_zoo_text_recognition_crnn --input=/path/to/image --model=text_recognition_CRNN_CN_2021nov.onnx --charset=charset_3944_CN.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--charset=charset_3944_CN.txt
I dont see we have this file in this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be there is something I don't understand : in readme
Selected model must match with the charset:
Try text_recognition_CRNN_EN_2021sep.onnx with charset_36_EN.txt.
Try text_recognition_CRNN_CH_2021sep.onnx with charset_94_CH.txt
Try text_recognition_CRNN_CN_2021sep.onnx with charset_3944_CN.txt.
Then i understand that model gives charset to use then in code I use those line
if (this->modelPath.find("_EN_") != string::npos)
this->charset = loadCharset("CHARSET_EN_36");
else if (this->modelPath.find("_CH_") != string::npos)
this->charset = loadCharset("CHARSET_CH_94");
else if (this->modelPath.find("_CN_") != string::npos)
this->charset = loadCharset("CHARSET_CN_3944");
else
{
CV_Error(-1, "Charset not supported! Exiting ...");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We integrated charset characters into the class wrapper crnn.py
from separate files, but forgot to update the information in readme. So the current readme is outdated, you might update in this pull request as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
new c++ sample https://github.com/opencv/opencv_zoo/tree/main/models/text_recognition_crnn