Skip to content
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

How to do only text detection on minidocr? #691

Open
R4Ajeti opened this issue Apr 13, 2024 · 1 comment
Open

How to do only text detection on minidocr? #691

R4Ajeti opened this issue Apr 13, 2024 · 1 comment

Comments

@R4Ajeti
Copy link

R4Ajeti commented Apr 13, 2024

How do I do only text detection on minidocr using models from here:
https://github.com/mindspore-lab/mindocr/blob/main/configs/det/dbnet/README.md
-> section 3. Results -> DBNet and DBNet++ were trained on the ICDAR2015, MSRA-TD500, SCUT-CTW1500, Total-Text, and MLT2017 datasets ...

Let for example I want text detection speed and accuracy of this one on my dataset (images folder):
MLT2017 | DBNet | D910x8-MS2.0-G | ResNet-18 | SynthText that has throughput = 344.8 img/s

Any example any help is appreciated.

BTW: What does "Throughput" mean exactly? In this contest, I mean in terms of what machine those stats are available.

EDITED: 1. Also why is the box detection per each word individual instead of being the same bounding box when all words are in the same line as it is on paddleocr? Is there any easy way I can archive it?
2. This code is working to detect and recognize but is very slow (0.9 seconds to detect a single image 1152x104px on macbook pro m3) I need a faster one with lower accuracy trade off and separated detection from recognition:

python tools/infer/text/predict_system.py --image_dir deploy/py_infer/images \
                                          --det_algorithm DB++  \
                                          --rec_algorithm CRNN
@horcham
Copy link
Collaborator

horcham commented Apr 16, 2024

Hello, for only detection, you could run

python tools/infer/text/predict_det.py  --image_dir {path_to_img or dir_to_imgs} --det_algorithm DB++

please refer to https://github.com/mindspore-lab/mindocr/blob/main/tools/infer/text/README.md for more details.

In the stats, the F-score and throughput are available on 8xAscend 910 with mindspore 2.0.

And if the detection and recognition is slow, you could try

  • in the yaml file, set --det_amp_level to O2 or O3 and pass it to predict_det.py

You could also modify the items --det_db_thresh, --det_db_box_thresh, --det_db_unclip_ratio and pass them to predict_det.py, to adjust the detection result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants