-
Notifications
You must be signed in to change notification settings - Fork 197
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 Detection: add ppocr-v2 detect -WIP #66
Conversation
the-star-sea
commented
Jun 29, 2022
- add demo
- add example in readme
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!
Newly added models do not need the old copyright.
Hi @the-star-sea. Since in OpenCV the |
ok.I will do it |
@the-star-sea the ppocr's speed is super fast.
|
|
Thank you @the-star-sea! The accuracy result is good. Which validation data are used? How many data it has? |
icdar2015.500 imgs. |
Thanks for the clarification. The model = cv.dnn_TextDetectionModel_DB(
cv.dnn.readNet(self._modelPath)
)
# time start
model.detect(image)
# time stop In order to get a fair speed comparison result, how did you test the speed of ppocr? |
I write the config file in benchmark and add function support in ppdetect.It just tests the speed of infering onnx model. |
That's a great answer. Thanks! model = cv.dnn_TextDetectionModel_DB(
cv.dnn.readNet(modelPath_ppocr)
)
model.detect(image) |
I think there need some changes because ppocr doesnot need polygon threhold.I will do it. |
@the-star-sea Please keep one in the mobile and normal models, as we discussed before, to avoid confusing users. |
ok.I will do 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.
LGTM!
|
||
Real-time Scene Text Detection with Differentiable Binarization | ||
|
||
This model is ported from [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR). |
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 adding the original model link here?
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 suggest we remove DB from opencv_zoo after this pull request is merged, make a new high level api specifically for this model in opencv and update the wrapper class.
models/__init__.py
Outdated
@@ -37,3 +37,4 @@ def register(self, item): | |||
MODELS.register(MobileNetV2) | |||
MODELS.register(MPPalmDet) | |||
MODELS.register(LPD_YuNet) | |||
MODELS.register(PPDetect) |
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.
EOL before EOF
Hi @fengyuentau, how about leaving it to the next PR to remove |
Sure, thats exactly what I meant. Just want to emphasize this plan. |
@zihaomu Please update benchmark results on this model. |
Hi, @fengyuentau the benchmark results will be updated at PR #73, the student will complete it in the near future. |
When we add or update a model in opencv zoo, we always update the average forward latency in the same pull request. |
Ok, let's wait. |
We dont need to wait for #73 as it is for accuracy. At least we need the speed of this model to merge a pull request of adding or updating a model. |
After this PR is merged, PP-OCR_v3 can be supported and loaded with high-level API. And I think we can only put PP-OCR_v3 in |
help_msg_backends += "; {:d}: TIMVX" | ||
help_msg_targets += "; {:d}: NPU" | ||
except: | ||
print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more 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.
It looks very strange that sample proposes to use external gist, bug not official documentation or wiki. I propose to use https://github.com/opencv/opencv/wiki/TIM-VX-Backend-For-Running-OpenCV-On-NPU. @fengyuentau Please extend wiki page if something is missing there.
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 the review. IIRC, this link was added before we have the wiki in opencv. Will update this in a separate pull request.
Didn't we agree on adding this model (pp-ocr) in place of db? Why are we closing this PR? |
We can directly support ppocr-DB v2 and v3 at new API. |