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
Add CRAFT character detection node and OCR node. #2650
Conversation
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.
Sorry, my reviews are WIP.
I will add more reviews later.
craft_node.py | ||
============= | ||
|
||
What is this? |
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.
How about writing the Quick Start in the comments of this PR in the README as well?
For example, the following information seems very important to me.
For python2 users, please do pip install pytesseract==0.3.1 manually because the latest version of pytesseract is not installed automatically.
In addition, I was confused when installing pytorch with python2.
The followint web page show only for python3 user.
https://pytorch.org/get-started/locally/
Could you please add pytorch installation process for python 2 users?
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.
Related to the these python version problem, how about using catkin_virtualenv
to use the latest pip programs with Python3.x.
I think this makes the installation process easier.
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.
Related to the these python version problem, how about using catkin_virtualenv to use the latest pip programs with Python3.x. I think this makes the installation process easier.
I'm not familiar with catkin_virtualenv
. I have a question.
catkin_install_python needs to call catkin_install_python, but the script files are already written as a target in CMakelists.txt in jsk_perception. https://github.com/jsk-ros-pkg/jsk_recognition/blob/master/jsk_perception/CMakeLists.txt#L430-L435
Does this mean that the script files also need to be changed to work with python3?
If that is true, I think we need to address it with another PR.
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.
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'm not familiar with catkin_virtualenv. I have a question.
catkin_install_python needs to call catkin_install_python, but the script files are already written as a target in CMakelists.txt in jsk_perception. master/jsk_perception/CMakeLists.txt#L430-L435
Does this mean that the script files also need to be changed to work with python3?
I am very sorry, but you are right. We should not use catkin_virtualenv
.
This process will also override the standard catkin_install_python macro to wrap a virtualenv loader around the specified python scripts.
https://github.com/locusrobotics/catkin_virtualenv
In addition to that, using catkin_virtualenv
adds new dependency to jsk_perception
. So we should not use catkin_virtualenv
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.
OK. I understand it.
Thank you very much for your help. Is it difficult to add a test to this?
|
|
||
.. code-block:: bash | ||
|
||
pip install --user torch-1.1.0-cp27-cp27mu-linux_x86_64.whl |
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 have a question.
You say (pytorch >= 1.4.0 is recommended)
, but the installed torch version seems 1.1.0
Does this mean "Python3 users should use torch>=1.4.0, but Python2 users should use torch=1.1.0" ?
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.
OK. I modified the description.
a4beeae
Please check it
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.
Thank you!
Very easy to understand.
When no character is found, I got the error. Could you check this PR? |
Merged. Thanks! |
I think this PR works well. After tests pass, it will be OK to merge. I have a simple question. (Maybe future work) When the characters are parallel to the image, the recognition accuracy is high. However, when it is not, the recognition accuracy seems to be low. How can we avoid this? |
* ``~gpu`` (Int, default: ``0``) | ||
|
||
GPU id. |
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.
If a version that runs on the CPU is supported, it might be easier for users to understand when the value to set in the case of the CPU is written like https://github.com/jsk-ros-pkg/jsk_recognition/blame/master/doc/jsk_perception/nodes/hand_pose_estimation_2d.rst#L39-L41
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.
85a4d68
Thanks. I added the information.
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.
Thank you!
kinetic, melodic, noetic and noetic-full tests do not start. For example,
https://github.com/jsk-ros-pkg/jsk_recognition/actions/runs/1619482923 This may be solved with: SamKirkland/FTP-Deploy-Action#202 (comment) |
I modified the crop code. |
melodic test fails because
https://github.com/jsk-ros-pkg/jsk_recognition/runs/4628721970?check_suite_focus=true We may need to add
to |
kinetic, noetic and noetic-full tests fail maybe because format of BEFORE_SCRIPT is not correct (as iory checked with ce1bf09) |
5f1d22e
to
13c8ba2
Compare
LGTM, I could execute the node successfully. |
|
I resolved conflicts. I'm waiting for test results. |
185e519
to
11cbc31
Compare
@iory please update jsk_travis too, https://github.com/jsk-ros-pkg/jsk_travis/blob/master/docker/Dockerfile.ros-ubuntu:14.04-pcl#L57 |
@@ -92,6 +92,7 @@ | |||
<exec_depend>leveldb</exec_depend> | |||
<exec_depend>python-fcn-pip</exec_depend> <!-- pip --> | |||
<!-- }} install fcn --> | |||
<exec_depend version_lt="0.3.7">python-pytesseract-pip</exec_depend> |
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.
@iory Isn't this 0.3.6
? 0.3.7
causes syntax error.
Sorry, my mistake.
I overlooked version_lt, means "less than"
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.
OK. Thanks.
OK. I created a PR. jsk-ros-pkg/jsk_travis#451 |
What is this?
Add
CRAFT: Character-Region Awareness For Text detection
. node which detects text region from image andadd Optical Character Reader (OCR) node from image and text area.
This PR is developed on top of this PR.
#2648
Quick Start
Please do
rosdep install
andcatkin build jsk_perception
at first.In order to use this feature, you need to install
pytorch <https://pytorch.org/get-started/locally/>
(pytorch >= 1.9.0 is recommended).However, python2 user is not supposed to be able to install that version of torch.
For python2 users, download the appropriate wheel file in your environment from https://download.pytorch.org/whl/cu90/torch_stable.html (melodic) and install with pip as follow:
For python2 users, please do
pip install pytesseract==0.3.1
manually because the latest version of pytesseract is not installed automatically.After that, you can run the following command.
Japanese OCR recognition
If you want to use a language other than English,
please install the appropriate language data and change the
language
argument.For example, if you want to use Japanese,
please install
tesseract-ocr-jpn
(apt install tesseract-ocr-jpn
inUbuntu
) and passjpn
as thelanguage
argument.