-
Notifications
You must be signed in to change notification settings - Fork 975
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 formula model #2727
add formula model #2727
Conversation
Thanks for your contribution! |
152fd85
to
e9a3f5d
Compare
@@ -8,7 +8,7 @@ Global: | |||
CheckDataset: | |||
convert: | |||
enable: True | |||
src_dataset_type: MSTextRecDataset | |||
src_dataset_type: FormulaRecDataset |
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.
这块现在做到了统一?
@@ -0,0 +1,40 @@ | |||
Global: | |||
model: PP-FormulaNet-L_rec |
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.
我记得这个模型的名字没带rec吧?
@@ -0,0 +1,40 @@ | |||
Global: | |||
model: PP-FormulaNet-S_rec |
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.
同上
@@ -0,0 +1,40 @@ | |||
Global: | |||
model: UniMERNet_rec |
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.
这里是不也没必要加rec,和原始论文保持一致
LaTeXOCRDecode, | ||
NormalizeImage, | ||
ToBatch, | ||
UniMERNetImgDecode, |
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.
这些类如果PP-FormulaNet也用得到的话,建议改为FormulaNetImgDecode
,下同
from PIL import Image, ImageDraw, ImageFont | ||
|
||
from ....utils.fonts import PINGFANG_FONT_FILE_PATH | ||
from ...common.result import BaseCVResult |
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 collections import defaultdict, Counter | ||
|
||
from PIL import Image | ||
import json |
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.
这里的引用顺序不太对
meta["val_samples"] = sample_cnts["val"] | ||
meta["val_sample_paths"] = sample_paths["val"][:sample_num] | ||
|
||
# meta['dict_file'] = dict_file |
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.
删除多余注释
@@ -107,6 +107,7 @@ Eval: | |||
keep_smaller_batches: True | |||
transforms: | |||
- DecodeImage: | |||
img_mode: RGB |
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.
此处改的目的是?之前有bug?
@@ -197,12 +197,3 @@ | |||
"supported_apis": ["train", "evaluate", "predict", "export", "infer"], | |||
} | |||
) | |||
|
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.
LaTeX-OCR已经移到 formula_rec 的 register了,所以就下掉了。
c75bd38
to
353fe4c
Compare
No description provided.