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

add formula model #2727

Conversation

liuhongen1234567
Copy link
Collaborator

No description provided.

Copy link

paddle-bot bot commented Dec 24, 2024

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Dec 24, 2024

CLA assistant check
All committers have signed the CLA.

@@ -8,7 +8,7 @@ Global:
CheckDataset:
convert:
enable: True
src_dataset_type: MSTextRecDataset
src_dataset_type: FormulaRecDataset
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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,
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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"],
}
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个下掉的目的是?

Copy link
Collaborator Author

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了,所以就下掉了。

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

Successfully merging this pull request may close these issues.

3 participants