Replace tesseract with PaddleOCR #5

Closed
Yun wants to merge 2 commits from Yun/videocr:master into master
Contributor

PaddleOCR is a bit slower but seems to have a more advanced architecture and much better chinese models available than tesseract.

Install PaddleOCR 1.1: python -m pip install paddleocr==1.1.1 or

Install PaddleOCR 2.0+ from source (the version from pip seems to be really slow with cpu atm):

  1. clone https://github.com/PaddlePaddle/PaddleOCR

  2. if running python 3.8+, you may need to modify the requirements.txt to use opencv-contrib-python>=4.2.0.32 instead of opencv-contrib-python==4.2.0.32

  3. from the project root directory run python -m pip install -e .

PaddleOCR also requires installation of PaddlePaddle:

  1. python -m pip install paddlepaddle or python -m pip install paddlepaddle-gpu if you have a CUDA9 or CUDA10 gpu

With the mobile models listed in their git repo, it seems the 1.1 models might perform a bit better than the 2.0 models that are used by default. Gonna test this a bit more.

Update: yeah so it turns out the 2.0 mobile models don't seem to perform as well as the 1.1 mobile models. With paddleocr 2.0, would have to use the slower but more accurate server models. There are also PaddleLite models but I'm not sure how to run those.

Update 2: Actually with dilation before threshold and filtering out nonwhite pixels, the 2.0 mobile models perform decent

PaddleOCR is a bit slower but seems to have a more advanced architecture and much better chinese models available than tesseract. Install PaddleOCR 1.1: `python -m pip install paddleocr==1.1.1` or Install PaddleOCR 2.0+ from source (the version from pip seems to be really slow with cpu atm): 1. clone https://github.com/PaddlePaddle/PaddleOCR 2. if running python 3.8+, you may need to modify the requirements.txt to use `opencv-contrib-python>=4.2.0.32` instead of `opencv-contrib-python==4.2.0.32` 3. from the project root directory run `python -m pip install -e .` PaddleOCR also requires installation of PaddlePaddle: 1. `python -m pip install paddlepaddle` or `python -m pip install paddlepaddle-gpu` if you have a CUDA9 or CUDA10 gpu With the mobile models listed in their git repo, it seems the 1.1 models might perform a bit better than the 2.0 models that are used by default. Gonna test this a bit more. Update: yeah so it turns out the 2.0 mobile models don't seem to perform as well as the 1.1 mobile models. With paddleocr 2.0, would have to use the slower but more accurate server models. There are also PaddleLite models but I'm not sure how to run those. Update 2: Actually with dilation before threshold and filtering out nonwhite pixels, the 2.0 mobile models perform decent
Yun added 2 commits 2021-07-16 17:14:05 +02:00
Yun closed this pull request 2021-07-19 06:43:54 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: pradana.aumars/videocr#5
No description provided.