- Notifications
You must be signed in to change notification settings - Fork 260
Text recognition crnn #176
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
Changes from 7 commits
b1c7531 ff21424 47e96f9 78954be ca5bf45 4ecba35 c7181ed 8694617 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| cmake_minimum_required(VERSION 3.24) | ||
| set(project_name "opencv_zoo_text_recognition_crnn") | ||
| | ||
| PROJECT (${project_name}) | ||
| | ||
| set(OPENCV_VERSION "4.7.0") | ||
| set(OPENCV_INSTALLATION_PATH "" CACHE PATH "Where to look for OpenCV installation") | ||
| find_package(OpenCV ${OPENCV_VERSION} REQUIRED HINTS ${OPENCV_INSTALLATION_PATH}) | ||
| # Find OpenCV, you may need to set OpenCV_DIR variable | ||
| # to the absolute path to the directory containing OpenCVConfig.cmake file | ||
| # via the command line or GUI | ||
| | ||
| file(GLOB SourceFile | ||
| "demo.cpp") | ||
| # If the package has been found, several variables will | ||
| # be set, you can find the full list with descriptions | ||
| # in the OpenCVConfig.cmake file. | ||
| # Print some message showing some of them | ||
| message(STATUS "OpenCV library status:") | ||
| message(STATUS " config: ${OpenCV_DIR}") | ||
| message(STATUS " version: ${OpenCV_VERSION}") | ||
| message(STATUS " libraries: ${OpenCV_LIBS}") | ||
| message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}") | ||
| | ||
| # Declare the executable target built from your sources | ||
| add_executable(${project_name} ${SourceFile}) | ||
| | ||
| # Link your application with OpenCV libraries | ||
| target_link_libraries(${project_name} PRIVATE ${OpenCV_LIBS}) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -36,6 +36,8 @@ Note: | |
| - Try `text_recognition_CRNN_CH_2021sep.onnx` with `charset_94_CH.txt` | ||
| - Try `text_recognition_CRNN_CN_2021sep.onnx` with `charset_3944_CN.txt`. | ||
| | ||
| ### Python | ||
| | ||
| Run the demo detecting English: | ||
| | ||
| ```shell | ||
| | @@ -59,6 +61,31 @@ python demo.py --input /path/to/image --model text_recognition_CRNN_CN_2021nov.o | |
| # get help regarding various parameters | ||
| python demo.py --help | ||
| ``` | ||
| ### C++ | ||
| | ||
| Install latest OpenCV and CMake >= 3.24.0 to get started with: | ||
| | ||
| ```shell | ||
| # 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 | ||
| Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to use Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ./build/opencv_zoo_text_recognition_crnn -v=0 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think just be as consistent as possible with other demos Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Just modify the doc here to make sure the commands work. It does not worth making 100% same behavior as Python demos. | ||
| | ||
| # get help regarding various parameters | ||
| ./build/opencv_zoo_text_recognition_crnn --help | ||
| ``` | ||
| | ||
| Run the demo detecting Chinese: | ||
| | ||
| ```shell | ||
| # detect on camera input | ||
| ./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 | ||
| Comment on lines +82 to +84 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be there is something I don't understand : in readme Then i understand that model gives charset to use then in code I use those line Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We integrated charset characters into the class wrapper | ||
| | ||
| # get help regarding various parameters | ||
| ./build/opencv_zoo_text_recognition_crnn --help | ||
| | ||
| | ||
| ### Examples | ||
| | ||
| | ||
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.