Unverified Commit 73f66af9 authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Merge pull request #584 from myhloli/update-unimernet-to-0.2.0

refactor(pdf_extract_kit): update model config and weight paths for UniMERNet-0.2.0
parents 322790c2 ddd61a11
...@@ -58,7 +58,7 @@ def mfd_model_init(weight): ...@@ -58,7 +58,7 @@ def mfd_model_init(weight):
def mfr_model_init(weight_dir, cfg_path, _device_='cpu'): def mfr_model_init(weight_dir, cfg_path, _device_='cpu'):
args = argparse.Namespace(cfg_path=cfg_path, options=None) args = argparse.Namespace(cfg_path=cfg_path, options=None)
cfg = Config(args) cfg = Config(args)
cfg.config.model.pretrained = os.path.join(weight_dir, "pytorch_model.bin") cfg.config.model.pretrained = os.path.join(weight_dir, "pytorch_model.pth")
cfg.config.model.model_config.model_name = weight_dir cfg.config.model.model_config.model_name = weight_dir
cfg.config.model.tokenizer_config.path = weight_dir cfg.config.model.tokenizer_config.path = weight_dir
task = tasks.setup_task(cfg) task = tasks.setup_task(cfg)
......
...@@ -2,13 +2,13 @@ model: ...@@ -2,13 +2,13 @@ model:
arch: unimernet arch: unimernet
model_type: unimernet model_type: unimernet
model_config: model_config:
model_name: ./models model_name: ./models/unimernet_base
max_seq_len: 1024 max_seq_len: 1536
length_aware: False
load_pretrained: True load_pretrained: True
pretrained: ./models/pytorch_model.bin pretrained: './models/unimernet_base/pytorch_model.pth'
tokenizer_config: tokenizer_config:
path: ./models path: ./models/unimernet_base
datasets: datasets:
formula_rec_eval: formula_rec_eval:
......
...@@ -10,6 +10,6 @@ config: ...@@ -10,6 +10,6 @@ config:
weights: weights:
layout: Layout/model_final.pth layout: Layout/model_final.pth
mfd: MFD/weights.pt mfd: MFD/weights.pt
mfr: MFR/UniMERNet mfr: MFR/unimernet_base
struct_eqtable: TabRec/StructEqTable struct_eqtable: TabRec/StructEqTable
TableMaster: TabRec/TableMaster TableMaster: TabRec/TableMaster
\ No newline at end of file
...@@ -8,7 +8,7 @@ fast-langdetect==0.2.0 ...@@ -8,7 +8,7 @@ fast-langdetect==0.2.0
wordninja>=2.0.0 wordninja>=2.0.0
scikit-learn>=1.0.2 scikit-learn>=1.0.2
pdfminer.six==20231228 pdfminer.six==20231228
unimernet==0.1.6 unimernet==0.2.0
matplotlib matplotlib
ultralytics ultralytics
paddleocr==2.7.3 paddleocr==2.7.3
......
...@@ -36,7 +36,7 @@ if __name__ == '__main__': ...@@ -36,7 +36,7 @@ if __name__ == '__main__':
"paddlepaddle==3.0.0b1;platform_system=='Linux'", "paddlepaddle==3.0.0b1;platform_system=='Linux'",
"paddlepaddle==2.6.1;platform_system=='Windows' or platform_system=='Darwin'", "paddlepaddle==2.6.1;platform_system=='Windows' or platform_system=='Darwin'",
], ],
"full": ["unimernet==0.1.6", # 0.1.6版本大幅裁剪依赖包范围,推荐使用此版本 "full": ["unimernet==0.2.0", # unimernet升级0.2.0
"matplotlib<=3.9.0;platform_system=='Windows'", # 3.9.1及之后不提供windows的预编译包,避免一些没有编译环境的windows设备安装失败 "matplotlib<=3.9.0;platform_system=='Windows'", # 3.9.1及之后不提供windows的预编译包,避免一些没有编译环境的windows设备安装失败
"matplotlib;platform_system=='Linux' or platform_system=='Darwin'", # linux 和 macos 不应限制matplotlib的最高版本,以避免无法更新导致的一些bug "matplotlib;platform_system=='Linux' or platform_system=='Darwin'", # linux 和 macos 不应限制matplotlib的最高版本,以避免无法更新导致的一些bug
"ultralytics", # yolov8,公式检测 "ultralytics", # yolov8,公式检测
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment