-
Notifications
You must be signed in to change notification settings - Fork 8k
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 new recognition method "ParseQ" #10836
Conversation
* Update PP-OCRv4_introduction.md * Update PP-OCRv4_introduction.md * Update PP-OCRv4_introduction.md
…Paddle:Release/2.7 (PaddlePaddle#10655) * Don't break overall processing on a bad image * Add preprocessing common to OCR tasks Add preprocessing to options
added missing pyyaml library
Co-authored-by: Dennis <dvorst@users.noreply.github.com> Co-authored-by: shiyutang <34859558+shiyutang@users.noreply.github.com>
* 修改数据增强导致的DSR报错 * 错误修改回滚
Fixed simple spelling errors.
Thanks for your contribution! |
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.
另外新增算法请提交至 dygraph 分支
configs/rec/rec_vit_parseq.yml
Outdated
use_visualdl: False | ||
infer_img: doc/imgs_words_en/word_10.png | ||
# for data or label process | ||
character_dict_path: /ssd3/suzejia/newAlgOCR/ppocr/utils/dict/parseq_dict.txt |
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.
请上传字典,并提供github上的相对路径
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.
字典已上传,并相应修改configs中的路径
ppocr/data/imaug/rec_img_aug.py
Outdated
self.image_shape = image_shape | ||
self.dst_h, self.dst_w = image_shape[1], image_shape[2] | ||
|
||
def __call__(self, data): |
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.
没有特殊的操作,可以看下能否复用之前的resize呢?
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.
已复用SVTR的resize
ones_(m.weight) | ||
|
||
def forward_features(self, x): | ||
# B = x.shape[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.
不需要的注释删除
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.
嗯嗯,已删除
from typing import Optional | ||
import copy | ||
from itertools import permutations | ||
|
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.
如果代码参考了其他repo,加一下 code refer, 参考:
This code is refer from:
https://github.com/PaddlePaddle/PaddleClas/blob/release%2F2.5/ppcls/arch/backbone/model_zoo/vision_transformer.py
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.
已增加code refer
sz = perm.shape[0] | ||
mask = paddle.zeros(shape=(sz, sz)) | ||
for i in range(sz): | ||
query_idx = perm[i].cpu().numpy().tolist() |
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.
必须要转numpy吗?
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.
tools/infer/predict_rec.py
Outdated
@@ -348,6 +354,17 @@ def resize_norm_img_svtr(self, img, image_shape): | |||
resized_image /= 0.5 | |||
return resized_image | |||
|
|||
def resize_norm_img_parseq(self, img, image_shape): |
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.
已复用SVTR的resize
已修改至dygraph分支 |
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
No description provided.