Add PDF-Extract-Kit-1.0 models
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +2 -0
- README.md +26 -3
- models/Layout/LayoutLMv3/config.json +33 -0
- models/Layout/LayoutLMv3/model_final.pth +3 -0
- models/Layout/YOLO/yolov10l_ft.pt +3 -0
- models/MFD/YOLO/yolo_v8_ft.pt +3 -0
- models/MFR/UniMERNet/README.md +6 -0
- models/MFR/UniMERNet/config.json +193 -0
- models/MFR/UniMERNet/preprocessor_config.json +36 -0
- models/MFR/UniMERNet/pytorch_model.bin +3 -0
- models/MFR/UniMERNet/tokenizer.json +0 -0
- models/MFR/UniMERNet/tokenizer_config.json +205 -0
- models/MFR/unimernet_base/.mdl +0 -0
- models/MFR/unimernet_base/.msc +0 -0
- models/MFR/unimernet_base/.mv +1 -0
- models/MFR/unimernet_base/README.md +48 -0
- models/MFR/unimernet_base/config.json +193 -0
- models/MFR/unimernet_base/configuration.json +1 -0
- models/MFR/unimernet_base/preprocessor_config.json +36 -0
- models/MFR/unimernet_base/pytorch_model.pth +3 -0
- models/MFR/unimernet_base/tokenizer.json +0 -0
- models/MFR/unimernet_base/tokenizer_config.json +205 -0
- models/MFR/unimernet_base/unimernet_base.yaml +46 -0
- models/MFR/unimernet_small/.mdl +0 -0
- models/MFR/unimernet_small/.msc +0 -0
- models/MFR/unimernet_small/.mv +1 -0
- models/MFR/unimernet_small/README.md +47 -0
- models/MFR/unimernet_small/config.json +193 -0
- models/MFR/unimernet_small/configuration.json +1 -0
- models/MFR/unimernet_small/preprocessor_config.json +36 -0
- models/MFR/unimernet_small/pytorch_model.pth +3 -0
- models/MFR/unimernet_small/tokenizer.json +0 -0
- models/MFR/unimernet_small/tokenizer_config.json +205 -0
- models/MFR/unimernet_small/unimernet_small.yaml +46 -0
- models/MFR/unimernet_tiny/.mdl +0 -0
- models/MFR/unimernet_tiny/.msc +0 -0
- models/MFR/unimernet_tiny/.mv +1 -0
- models/MFR/unimernet_tiny/README.md +48 -0
- models/MFR/unimernet_tiny/config.json +193 -0
- models/MFR/unimernet_tiny/configuration.json +1 -0
- models/MFR/unimernet_tiny/preprocessor_config.json +36 -0
- models/MFR/unimernet_tiny/pytorch_model.pth +3 -0
- models/MFR/unimernet_tiny/tokenizer.json +0 -0
- models/MFR/unimernet_tiny/tokenizer_config.json +205 -0
- models/MFR/unimernet_tiny/unimernet_tiny.yaml +46 -0
- models/README.md +75 -0
- models/TabRec/StructEqTable/config.json +36 -0
- models/TabRec/StructEqTable/generation_config.json +8 -0
- models/TabRec/StructEqTable/model.safetensors +3 -0
- models/TabRec/StructEqTable/preprocessor_config.json +12 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.pdiparams filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.pdmodel filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[MinerU](https://github.com/opendatalab/MinerU)项目中使用的模型,欢迎下载使用。
|
2 |
+
模型使用请参考[PDF-Extract-Kit](https://github.com/opendatalab/PDF-Extract-Kit)项目。
|
3 |
+
|
4 |
+
### SDK Download
|
5 |
+
|
6 |
+
```bash
|
7 |
+
# First, install the ModelScope library using pip:
|
8 |
+
pip install modelscope
|
9 |
+
```
|
10 |
+
|
11 |
+
```python
|
12 |
+
# Use the following Python code to download the model using the ModelScope SDK:
|
13 |
+
from modelscope import snapshot_download
|
14 |
+
model_dir = snapshot_download('opendatalab/PDF-Extract-Kit')
|
15 |
+
```
|
16 |
+
|
17 |
+
### Git Download
|
18 |
+
Alternatively, you can use Git to clone the model repository from ModelScope:
|
19 |
+
|
20 |
+
```bash
|
21 |
+
git clone https://www.modelscope.cn/opendatalab/PDF-Extract-Kit.git
|
22 |
+
```
|
23 |
+
|
24 |
+
---
|
25 |
+
license: apache-2.0
|
26 |
+
---
|
models/Layout/LayoutLMv3/config.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"attention_probs_dropout_prob": 0.1,
|
3 |
+
"bos_token_id": 0,
|
4 |
+
"classifier_dropout": null,
|
5 |
+
"coordinate_size": 128,
|
6 |
+
"eos_token_id": 2,
|
7 |
+
"has_relative_attention_bias": true,
|
8 |
+
"has_spatial_attention_bias": true,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"input_size": 224,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_2d_position_embeddings": 1024,
|
17 |
+
"max_position_embeddings": 514,
|
18 |
+
"max_rel_2d_pos": 256,
|
19 |
+
"max_rel_pos": 128,
|
20 |
+
"model_type": "layoutlmv3",
|
21 |
+
"num_attention_heads": 12,
|
22 |
+
"num_hidden_layers": 12,
|
23 |
+
"pad_token_id": 1,
|
24 |
+
"rel_2d_pos_bins": 64,
|
25 |
+
"rel_pos_bins": 32,
|
26 |
+
"second_input_size": 112,
|
27 |
+
"shape_size": 128,
|
28 |
+
"torch_dtype": "float32",
|
29 |
+
"transformers_version": "4.12.5",
|
30 |
+
"type_vocab_size": 1,
|
31 |
+
"visual_embed": true,
|
32 |
+
"vocab_size": 250002
|
33 |
+
}
|
models/Layout/LayoutLMv3/model_final.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd2402ed4dd01de36c659a1e7dad35541adb2265df8599f0a071b1cb66bbbc5c
|
3 |
+
size 564052519
|
models/Layout/YOLO/yolov10l_ft.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fad2c4c27428e5525460321a099327bb9810880934ee9e3e1a68d25d22887cd6
|
3 |
+
size 52275810
|
models/MFD/YOLO/yolo_v8_ft.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:41029d5abb9b0b6df825ecaf8adf9151762ea0688ac0fc4ea0ea34ab9a5808fc
|
3 |
+
size 349867002
|
models/MFR/UniMERNet/README.md
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
UniMERNet: A Universal Network for Mathematical Expression Recognition in Real-World Scenarios.
|
5 |
+
|
6 |
+
Visit our GitHub repository at [unimernet](https://github.com/opendatalab/unimernet) for more information.
|
models/MFR/UniMERNet/config.json
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "unimernet/checkpoint-180000",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "gelu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"add_final_layer_norm": true,
|
12 |
+
"architectures": null,
|
13 |
+
"attention_dropout": 0.0,
|
14 |
+
"bad_words_ids": null,
|
15 |
+
"begin_suppress_tokens": null,
|
16 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"classifier_dropout": 0.0,
|
19 |
+
"cross_attention_hidden_size": null,
|
20 |
+
"d_model": 1024,
|
21 |
+
"decoder_attention_heads": 16,
|
22 |
+
"decoder_ffn_dim": 4096,
|
23 |
+
"decoder_layerdrop": 0.0,
|
24 |
+
"decoder_layers": 8,
|
25 |
+
"decoder_start_token_id": null,
|
26 |
+
"diversity_penalty": 0.0,
|
27 |
+
"do_sample": false,
|
28 |
+
"dropout": 0.1,
|
29 |
+
"early_stopping": false,
|
30 |
+
"encoder_attention_heads": 16,
|
31 |
+
"encoder_ffn_dim": 4096,
|
32 |
+
"encoder_layerdrop": 0.0,
|
33 |
+
"encoder_layers": 12,
|
34 |
+
"encoder_no_repeat_ngram_size": 0,
|
35 |
+
"eos_token_id": 2,
|
36 |
+
"exponential_decay_length_penalty": null,
|
37 |
+
"finetuning_task": null,
|
38 |
+
"forced_bos_token_id": null,
|
39 |
+
"forced_eos_token_id": 2,
|
40 |
+
"id2label": {
|
41 |
+
"0": "LABEL_0",
|
42 |
+
"1": "LABEL_1"
|
43 |
+
},
|
44 |
+
"init_std": 0.02,
|
45 |
+
"is_decoder": true,
|
46 |
+
"is_encoder_decoder": false,
|
47 |
+
"label2id": {
|
48 |
+
"LABEL_0": 0,
|
49 |
+
"LABEL_1": 1
|
50 |
+
},
|
51 |
+
"length_penalty": 1.0,
|
52 |
+
"max_length": 20,
|
53 |
+
"max_position_embeddings": 1536,
|
54 |
+
"min_length": 0,
|
55 |
+
"model_type": "mbart",
|
56 |
+
"no_repeat_ngram_size": 0,
|
57 |
+
"num_beam_groups": 1,
|
58 |
+
"num_beams": 1,
|
59 |
+
"num_hidden_layers": 12,
|
60 |
+
"num_return_sequences": 1,
|
61 |
+
"output_attentions": false,
|
62 |
+
"output_hidden_states": false,
|
63 |
+
"output_scores": false,
|
64 |
+
"pad_token_id": 1,
|
65 |
+
"prefix": null,
|
66 |
+
"problem_type": null,
|
67 |
+
"pruned_heads": {},
|
68 |
+
"remove_invalid_values": false,
|
69 |
+
"repetition_penalty": 1.0,
|
70 |
+
"return_dict": true,
|
71 |
+
"return_dict_in_generate": false,
|
72 |
+
"scale_embedding": true,
|
73 |
+
"sep_token_id": null,
|
74 |
+
"suppress_tokens": null,
|
75 |
+
"task_specific_params": null,
|
76 |
+
"temperature": 1.0,
|
77 |
+
"tf_legacy_loss": false,
|
78 |
+
"tie_encoder_decoder": false,
|
79 |
+
"tie_word_embeddings": false,
|
80 |
+
"tokenizer_class": null,
|
81 |
+
"top_k": 50,
|
82 |
+
"top_p": 1.0,
|
83 |
+
"torch_dtype": null,
|
84 |
+
"torchscript": false,
|
85 |
+
"typical_p": 1.0,
|
86 |
+
"use_bfloat16": false,
|
87 |
+
"use_cache": true,
|
88 |
+
"vocab_size": 50000
|
89 |
+
},
|
90 |
+
"decoder_start_token_id": 0,
|
91 |
+
"encoder": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_probs_dropout_prob": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"begin_suppress_tokens": null,
|
98 |
+
"bos_token_id": null,
|
99 |
+
"chunk_size_feed_forward": 0,
|
100 |
+
"cross_attention_hidden_size": null,
|
101 |
+
"decoder_start_token_id": null,
|
102 |
+
"depths": [
|
103 |
+
2,
|
104 |
+
2,
|
105 |
+
14,
|
106 |
+
2
|
107 |
+
],
|
108 |
+
"diversity_penalty": 0.0,
|
109 |
+
"do_sample": false,
|
110 |
+
"drop_path_rate": 0.1,
|
111 |
+
"early_stopping": false,
|
112 |
+
"embed_dim": 128,
|
113 |
+
"encoder_no_repeat_ngram_size": 0,
|
114 |
+
"eos_token_id": null,
|
115 |
+
"exponential_decay_length_penalty": null,
|
116 |
+
"finetuning_task": null,
|
117 |
+
"forced_bos_token_id": null,
|
118 |
+
"forced_eos_token_id": null,
|
119 |
+
"hidden_act": "gelu",
|
120 |
+
"hidden_dropout_prob": 0.0,
|
121 |
+
"hidden_size": 1024,
|
122 |
+
"id2label": {
|
123 |
+
"0": "LABEL_0",
|
124 |
+
"1": "LABEL_1"
|
125 |
+
},
|
126 |
+
"image_size": [
|
127 |
+
420,
|
128 |
+
420
|
129 |
+
],
|
130 |
+
"initializer_range": 0.02,
|
131 |
+
"is_decoder": false,
|
132 |
+
"is_encoder_decoder": false,
|
133 |
+
"label2id": {
|
134 |
+
"LABEL_0": 0,
|
135 |
+
"LABEL_1": 1
|
136 |
+
},
|
137 |
+
"layer_norm_eps": 1e-05,
|
138 |
+
"length_penalty": 1.0,
|
139 |
+
"max_length": 20,
|
140 |
+
"min_length": 0,
|
141 |
+
"mlp_ratio": 4.0,
|
142 |
+
"model_type": "donut-swin",
|
143 |
+
"no_repeat_ngram_size": 0,
|
144 |
+
"num_beam_groups": 1,
|
145 |
+
"num_beams": 1,
|
146 |
+
"num_channels": 3,
|
147 |
+
"num_heads": [
|
148 |
+
4,
|
149 |
+
8,
|
150 |
+
16,
|
151 |
+
32
|
152 |
+
],
|
153 |
+
"num_layers": 4,
|
154 |
+
"num_return_sequences": 1,
|
155 |
+
"output_attentions": false,
|
156 |
+
"output_hidden_states": false,
|
157 |
+
"output_scores": false,
|
158 |
+
"pad_token_id": null,
|
159 |
+
"patch_size": 4,
|
160 |
+
"path_norm": true,
|
161 |
+
"prefix": null,
|
162 |
+
"problem_type": null,
|
163 |
+
"pruned_heads": {},
|
164 |
+
"qkv_bias": true,
|
165 |
+
"remove_invalid_values": false,
|
166 |
+
"repetition_penalty": 1.0,
|
167 |
+
"return_dict": true,
|
168 |
+
"return_dict_in_generate": false,
|
169 |
+
"sep_token_id": null,
|
170 |
+
"suppress_tokens": null,
|
171 |
+
"task_specific_params": null,
|
172 |
+
"temperature": 1.0,
|
173 |
+
"tf_legacy_loss": false,
|
174 |
+
"tie_encoder_decoder": false,
|
175 |
+
"tie_word_embeddings": true,
|
176 |
+
"tokenizer_class": null,
|
177 |
+
"top_k": 50,
|
178 |
+
"top_p": 1.0,
|
179 |
+
"torch_dtype": null,
|
180 |
+
"torchscript": false,
|
181 |
+
"typical_p": 1.0,
|
182 |
+
"use_2d_embeddings": false,
|
183 |
+
"use_absolute_embeddings": false,
|
184 |
+
"use_bfloat16": false,
|
185 |
+
"window_size": 5
|
186 |
+
},
|
187 |
+
"is_encoder_decoder": true,
|
188 |
+
"model_type": "vision-encoder-decoder",
|
189 |
+
"pad_token_id": 1,
|
190 |
+
"tie_word_embeddings": false,
|
191 |
+
"torch_dtype": "float32",
|
192 |
+
"transformers_version": "4.40.0"
|
193 |
+
}
|
models/MFR/UniMERNet/preprocessor_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_align_long_axis": false,
|
3 |
+
"do_normalize": false,
|
4 |
+
"do_pad": false,
|
5 |
+
"do_rescale": false,
|
6 |
+
"do_resize": false,
|
7 |
+
"do_thumbnail": false,
|
8 |
+
"feature_extractor_type": "DonutFeatureExtractor",
|
9 |
+
"image_mean": [
|
10 |
+
0.485,
|
11 |
+
0.456,
|
12 |
+
0.406
|
13 |
+
],
|
14 |
+
"image_processor_type": "VariableDonutImageProcessor",
|
15 |
+
"image_std": [
|
16 |
+
0.229,
|
17 |
+
0.224,
|
18 |
+
0.225
|
19 |
+
],
|
20 |
+
"max_size": {
|
21 |
+
"height": 192,
|
22 |
+
"width": 672
|
23 |
+
},
|
24 |
+
"patch_size": [
|
25 |
+
4,
|
26 |
+
4
|
27 |
+
],
|
28 |
+
"processor_class": "VariableDonutProcessor",
|
29 |
+
"resample": 2,
|
30 |
+
"rescale_factor": 0.00392156862745098,
|
31 |
+
"size": [
|
32 |
+
192,
|
33 |
+
672
|
34 |
+
],
|
35 |
+
"train": false
|
36 |
+
}
|
models/MFR/UniMERNet/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6c80486e05b8cfbb48324a8802a2909221d219dd46aa6a936b92f2225555935e
|
3 |
+
size 3750208149
|
models/MFR/UniMERNet/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
models/MFR/UniMERNet/tokenizer_config.json
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[START_REF]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"5": {
|
44 |
+
"content": "[END_REF]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"6": {
|
52 |
+
"content": "[IMAGE]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"7": {
|
60 |
+
"content": "<fragments>",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
},
|
67 |
+
"8": {
|
68 |
+
"content": "</fragments>",
|
69 |
+
"lstrip": false,
|
70 |
+
"normalized": false,
|
71 |
+
"rstrip": false,
|
72 |
+
"single_word": false,
|
73 |
+
"special": true
|
74 |
+
},
|
75 |
+
"9": {
|
76 |
+
"content": "<work>",
|
77 |
+
"lstrip": false,
|
78 |
+
"normalized": false,
|
79 |
+
"rstrip": false,
|
80 |
+
"single_word": false,
|
81 |
+
"special": true
|
82 |
+
},
|
83 |
+
"10": {
|
84 |
+
"content": "</work>",
|
85 |
+
"lstrip": false,
|
86 |
+
"normalized": false,
|
87 |
+
"rstrip": false,
|
88 |
+
"single_word": false,
|
89 |
+
"special": true
|
90 |
+
},
|
91 |
+
"11": {
|
92 |
+
"content": "[START_SUP]",
|
93 |
+
"lstrip": false,
|
94 |
+
"normalized": false,
|
95 |
+
"rstrip": false,
|
96 |
+
"single_word": false,
|
97 |
+
"special": true
|
98 |
+
},
|
99 |
+
"12": {
|
100 |
+
"content": "[END_SUP]",
|
101 |
+
"lstrip": false,
|
102 |
+
"normalized": false,
|
103 |
+
"rstrip": false,
|
104 |
+
"single_word": false,
|
105 |
+
"special": true
|
106 |
+
},
|
107 |
+
"13": {
|
108 |
+
"content": "[START_SUB]",
|
109 |
+
"lstrip": false,
|
110 |
+
"normalized": false,
|
111 |
+
"rstrip": false,
|
112 |
+
"single_word": false,
|
113 |
+
"special": true
|
114 |
+
},
|
115 |
+
"14": {
|
116 |
+
"content": "[END_SUB]",
|
117 |
+
"lstrip": false,
|
118 |
+
"normalized": false,
|
119 |
+
"rstrip": false,
|
120 |
+
"single_word": false,
|
121 |
+
"special": true
|
122 |
+
},
|
123 |
+
"15": {
|
124 |
+
"content": "[START_DNA]",
|
125 |
+
"lstrip": false,
|
126 |
+
"normalized": false,
|
127 |
+
"rstrip": false,
|
128 |
+
"single_word": false,
|
129 |
+
"special": true
|
130 |
+
},
|
131 |
+
"16": {
|
132 |
+
"content": "[END_DNA]",
|
133 |
+
"lstrip": false,
|
134 |
+
"normalized": false,
|
135 |
+
"rstrip": false,
|
136 |
+
"single_word": false,
|
137 |
+
"special": true
|
138 |
+
},
|
139 |
+
"17": {
|
140 |
+
"content": "[START_AMINO]",
|
141 |
+
"lstrip": false,
|
142 |
+
"normalized": false,
|
143 |
+
"rstrip": false,
|
144 |
+
"single_word": false,
|
145 |
+
"special": true
|
146 |
+
},
|
147 |
+
"18": {
|
148 |
+
"content": "[END_AMINO]",
|
149 |
+
"lstrip": false,
|
150 |
+
"normalized": false,
|
151 |
+
"rstrip": false,
|
152 |
+
"single_word": false,
|
153 |
+
"special": true
|
154 |
+
},
|
155 |
+
"19": {
|
156 |
+
"content": "[START_SMILES]",
|
157 |
+
"lstrip": false,
|
158 |
+
"normalized": false,
|
159 |
+
"rstrip": false,
|
160 |
+
"single_word": false,
|
161 |
+
"special": true
|
162 |
+
},
|
163 |
+
"20": {
|
164 |
+
"content": "[END_SMILES]",
|
165 |
+
"lstrip": false,
|
166 |
+
"normalized": false,
|
167 |
+
"rstrip": false,
|
168 |
+
"single_word": false,
|
169 |
+
"special": true
|
170 |
+
},
|
171 |
+
"21": {
|
172 |
+
"content": "[START_I_SMILES]",
|
173 |
+
"lstrip": false,
|
174 |
+
"normalized": false,
|
175 |
+
"rstrip": false,
|
176 |
+
"single_word": false,
|
177 |
+
"special": true
|
178 |
+
},
|
179 |
+
"22": {
|
180 |
+
"content": "[END_I_SMILES]",
|
181 |
+
"lstrip": false,
|
182 |
+
"normalized": false,
|
183 |
+
"rstrip": false,
|
184 |
+
"single_word": false,
|
185 |
+
"special": true
|
186 |
+
}
|
187 |
+
},
|
188 |
+
"additional_special_tokens": [],
|
189 |
+
"bos_token": "<s>",
|
190 |
+
"clean_up_tokenization_spaces": false,
|
191 |
+
"eos_token": "</s>",
|
192 |
+
"max_length": 4096,
|
193 |
+
"model_max_length": 768,
|
194 |
+
"pad_to_multiple_of": null,
|
195 |
+
"pad_token": "<pad>",
|
196 |
+
"pad_token_type_id": 0,
|
197 |
+
"padding_side": "right",
|
198 |
+
"processor_class": "VariableDonutProcessor",
|
199 |
+
"stride": 0,
|
200 |
+
"tokenizer_class": "NougatTokenizer",
|
201 |
+
"truncation_side": "right",
|
202 |
+
"truncation_strategy": "longest_first",
|
203 |
+
"unk_token": "<unk>",
|
204 |
+
"vocab_file": null
|
205 |
+
}
|
models/MFR/unimernet_base/.mdl
ADDED
Binary file (47 Bytes). View file
|
|
models/MFR/unimernet_base/.msc
ADDED
Binary file (523 Bytes). View file
|
|
models/MFR/unimernet_base/.mv
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Revision:master,CreatedAt:1725608506
|
models/MFR/unimernet_base/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
## UniMERNet: A Universal Network for Mathematical Expression Recognition in Real-World Scenarios.
|
5 |
+
|
6 |
+
Visit our GitHub repository at [UniMERNet](https://github.com/opendatalab/unimernet) for more information.
|
7 |
+
|
8 |
+
|
9 |
+
## 引用
|
10 |
+
```
|
11 |
+
@misc{wang2024unimernetuniversalnetworkrealworld,
|
12 |
+
title={UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition},
|
13 |
+
author={Bin Wang and Zhuangcheng Gu and Guang Liang and Chao Xu and Bo Zhang and Botian Shi and Conghui He},
|
14 |
+
year={2024},
|
15 |
+
eprint={2404.15254},
|
16 |
+
archivePrefix={arXiv},
|
17 |
+
primaryClass={cs.CV},
|
18 |
+
url={https://arxiv.org/abs/2404.15254},
|
19 |
+
}
|
20 |
+
|
21 |
+
@misc{wang2024cdmreliablemetricfair,
|
22 |
+
title={CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation},
|
23 |
+
author={Bin Wang and Fan Wu and Linke Ouyang and Zhuangcheng Gu and Rui Zhang and Renqiu Xia and Bo Zhang and Conghui He},
|
24 |
+
year={2024},
|
25 |
+
eprint={2409.03643},
|
26 |
+
archivePrefix={arXiv},
|
27 |
+
primaryClass={cs.CV},
|
28 |
+
url={https://arxiv.org/abs/2409.03643},
|
29 |
+
}
|
30 |
+
|
31 |
+
@misc{he2024opendatalabempoweringgeneralartificial,
|
32 |
+
title={OpenDataLab: Empowering General Artificial Intelligence with Open Datasets},
|
33 |
+
author={Conghui He and Wei Li and Zhenjiang Jin and Chao Xu and Bin Wang and Dahua Lin},
|
34 |
+
year={2024},
|
35 |
+
eprint={2407.13773},
|
36 |
+
archivePrefix={arXiv},
|
37 |
+
primaryClass={cs.DL},
|
38 |
+
url={https://arxiv.org/abs/2407.13773},
|
39 |
+
}
|
40 |
+
```
|
41 |
+
```
|
42 |
+
|
43 |
+
## MD5 checksums
|
44 |
+
```
|
45 |
+
97f4867b4ff4e9a96c8daba8aaa793b4 tokenizer_config.json
|
46 |
+
351652071425d3d36a634ccc8efb22e8 tokenizer.json
|
47 |
+
ff4391872dad6688f21ed140009d817b pytorch_model.pth
|
48 |
+
```
|
models/MFR/unimernet_base/config.json
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "unimernet/checkpoint-300000",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "gelu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"add_final_layer_norm": true,
|
12 |
+
"architectures": null,
|
13 |
+
"attention_dropout": 0.0,
|
14 |
+
"bad_words_ids": null,
|
15 |
+
"begin_suppress_tokens": null,
|
16 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"classifier_dropout": 0.0,
|
19 |
+
"cross_attention_hidden_size": null,
|
20 |
+
"d_model": 1024,
|
21 |
+
"decoder_attention_heads": 16,
|
22 |
+
"decoder_ffn_dim": 4096,
|
23 |
+
"decoder_layerdrop": 0.0,
|
24 |
+
"decoder_layers": 8,
|
25 |
+
"decoder_start_token_id": null,
|
26 |
+
"diversity_penalty": 0.0,
|
27 |
+
"do_sample": false,
|
28 |
+
"dropout": 0.1,
|
29 |
+
"early_stopping": false,
|
30 |
+
"encoder_attention_heads": 16,
|
31 |
+
"encoder_ffn_dim": 4096,
|
32 |
+
"encoder_layerdrop": 0.0,
|
33 |
+
"encoder_layers": 12,
|
34 |
+
"encoder_no_repeat_ngram_size": 0,
|
35 |
+
"eos_token_id": 2,
|
36 |
+
"exponential_decay_length_penalty": null,
|
37 |
+
"finetuning_task": null,
|
38 |
+
"forced_bos_token_id": null,
|
39 |
+
"forced_eos_token_id": 2,
|
40 |
+
"id2label": {
|
41 |
+
"0": "LABEL_0",
|
42 |
+
"1": "LABEL_1"
|
43 |
+
},
|
44 |
+
"init_std": 0.02,
|
45 |
+
"is_decoder": true,
|
46 |
+
"is_encoder_decoder": false,
|
47 |
+
"label2id": {
|
48 |
+
"LABEL_0": 0,
|
49 |
+
"LABEL_1": 1
|
50 |
+
},
|
51 |
+
"length_penalty": 1.0,
|
52 |
+
"max_length": 20,
|
53 |
+
"max_position_embeddings": 1536,
|
54 |
+
"min_length": 0,
|
55 |
+
"model_type": "mbart",
|
56 |
+
"no_repeat_ngram_size": 0,
|
57 |
+
"num_beam_groups": 1,
|
58 |
+
"num_beams": 1,
|
59 |
+
"num_hidden_layers": 12,
|
60 |
+
"num_return_sequences": 1,
|
61 |
+
"output_attentions": false,
|
62 |
+
"output_hidden_states": false,
|
63 |
+
"output_scores": false,
|
64 |
+
"pad_token_id": 1,
|
65 |
+
"prefix": null,
|
66 |
+
"problem_type": null,
|
67 |
+
"pruned_heads": {},
|
68 |
+
"remove_invalid_values": false,
|
69 |
+
"repetition_penalty": 1.0,
|
70 |
+
"return_dict": true,
|
71 |
+
"return_dict_in_generate": false,
|
72 |
+
"scale_embedding": true,
|
73 |
+
"sep_token_id": null,
|
74 |
+
"suppress_tokens": null,
|
75 |
+
"task_specific_params": null,
|
76 |
+
"temperature": 1.0,
|
77 |
+
"tf_legacy_loss": false,
|
78 |
+
"tie_encoder_decoder": false,
|
79 |
+
"tie_word_embeddings": false,
|
80 |
+
"tokenizer_class": null,
|
81 |
+
"top_k": 50,
|
82 |
+
"top_p": 1.0,
|
83 |
+
"torch_dtype": null,
|
84 |
+
"torchscript": false,
|
85 |
+
"typical_p": 1.0,
|
86 |
+
"use_bfloat16": false,
|
87 |
+
"use_cache": true,
|
88 |
+
"vocab_size": 50000
|
89 |
+
},
|
90 |
+
"decoder_start_token_id": 0,
|
91 |
+
"encoder": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_probs_dropout_prob": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"begin_suppress_tokens": null,
|
98 |
+
"bos_token_id": null,
|
99 |
+
"chunk_size_feed_forward": 0,
|
100 |
+
"cross_attention_hidden_size": null,
|
101 |
+
"decoder_start_token_id": null,
|
102 |
+
"depths": [
|
103 |
+
6,
|
104 |
+
6,
|
105 |
+
6,
|
106 |
+
6
|
107 |
+
],
|
108 |
+
"diversity_penalty": 0.0,
|
109 |
+
"do_sample": false,
|
110 |
+
"drop_path_rate": 0.1,
|
111 |
+
"early_stopping": false,
|
112 |
+
"embed_dim": 128,
|
113 |
+
"encoder_no_repeat_ngram_size": 0,
|
114 |
+
"eos_token_id": null,
|
115 |
+
"exponential_decay_length_penalty": null,
|
116 |
+
"finetuning_task": null,
|
117 |
+
"forced_bos_token_id": null,
|
118 |
+
"forced_eos_token_id": null,
|
119 |
+
"hidden_act": "gelu",
|
120 |
+
"hidden_dropout_prob": 0.0,
|
121 |
+
"hidden_size": 1024,
|
122 |
+
"id2label": {
|
123 |
+
"0": "LABEL_0",
|
124 |
+
"1": "LABEL_1"
|
125 |
+
},
|
126 |
+
"image_size": [
|
127 |
+
420,
|
128 |
+
420
|
129 |
+
],
|
130 |
+
"initializer_range": 0.02,
|
131 |
+
"is_decoder": false,
|
132 |
+
"is_encoder_decoder": false,
|
133 |
+
"label2id": {
|
134 |
+
"LABEL_0": 0,
|
135 |
+
"LABEL_1": 1
|
136 |
+
},
|
137 |
+
"layer_norm_eps": 1e-05,
|
138 |
+
"length_penalty": 1.0,
|
139 |
+
"max_length": 20,
|
140 |
+
"min_length": 0,
|
141 |
+
"mlp_ratio": 4.0,
|
142 |
+
"model_type": "donut-swin",
|
143 |
+
"no_repeat_ngram_size": 0,
|
144 |
+
"num_beam_groups": 1,
|
145 |
+
"num_beams": 1,
|
146 |
+
"num_channels": 3,
|
147 |
+
"num_heads": [
|
148 |
+
4,
|
149 |
+
8,
|
150 |
+
16,
|
151 |
+
32
|
152 |
+
],
|
153 |
+
"num_layers": 4,
|
154 |
+
"num_return_sequences": 1,
|
155 |
+
"output_attentions": false,
|
156 |
+
"output_hidden_states": false,
|
157 |
+
"output_scores": false,
|
158 |
+
"pad_token_id": null,
|
159 |
+
"patch_size": 4,
|
160 |
+
"path_norm": true,
|
161 |
+
"prefix": null,
|
162 |
+
"problem_type": null,
|
163 |
+
"pruned_heads": {},
|
164 |
+
"qkv_bias": true,
|
165 |
+
"remove_invalid_values": false,
|
166 |
+
"repetition_penalty": 1.0,
|
167 |
+
"return_dict": true,
|
168 |
+
"return_dict_in_generate": false,
|
169 |
+
"sep_token_id": null,
|
170 |
+
"suppress_tokens": null,
|
171 |
+
"task_specific_params": null,
|
172 |
+
"temperature": 1.0,
|
173 |
+
"tf_legacy_loss": false,
|
174 |
+
"tie_encoder_decoder": false,
|
175 |
+
"tie_word_embeddings": true,
|
176 |
+
"tokenizer_class": null,
|
177 |
+
"top_k": 50,
|
178 |
+
"top_p": 1.0,
|
179 |
+
"torch_dtype": null,
|
180 |
+
"torchscript": false,
|
181 |
+
"typical_p": 1.0,
|
182 |
+
"use_2d_embeddings": false,
|
183 |
+
"use_absolute_embeddings": false,
|
184 |
+
"use_bfloat16": false,
|
185 |
+
"window_size": 5
|
186 |
+
},
|
187 |
+
"is_encoder_decoder": true,
|
188 |
+
"model_type": "vision-encoder-decoder",
|
189 |
+
"pad_token_id": 1,
|
190 |
+
"tie_word_embeddings": false,
|
191 |
+
"torch_dtype": "float16",
|
192 |
+
"transformers_version": "4.36.0"
|
193 |
+
}
|
models/MFR/unimernet_base/configuration.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"framework":"Pytorch","task":"ocr-recognition"}
|
models/MFR/unimernet_base/preprocessor_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_align_long_axis": false,
|
3 |
+
"do_normalize": false,
|
4 |
+
"do_pad": false,
|
5 |
+
"do_rescale": false,
|
6 |
+
"do_resize": false,
|
7 |
+
"do_thumbnail": false,
|
8 |
+
"feature_extractor_type": "DonutFeatureExtractor",
|
9 |
+
"image_mean": [
|
10 |
+
0.485,
|
11 |
+
0.456,
|
12 |
+
0.406
|
13 |
+
],
|
14 |
+
"image_processor_type": "VariableDonutImageProcessor",
|
15 |
+
"image_std": [
|
16 |
+
0.229,
|
17 |
+
0.224,
|
18 |
+
0.225
|
19 |
+
],
|
20 |
+
"max_size": {
|
21 |
+
"height": 192,
|
22 |
+
"width": 672
|
23 |
+
},
|
24 |
+
"patch_size": [
|
25 |
+
4,
|
26 |
+
4
|
27 |
+
],
|
28 |
+
"processor_class": "VariableDonutProcessor",
|
29 |
+
"resample": 2,
|
30 |
+
"rescale_factor": 0.00392156862745098,
|
31 |
+
"size": [
|
32 |
+
192,
|
33 |
+
672
|
34 |
+
],
|
35 |
+
"train": false
|
36 |
+
}
|
models/MFR/unimernet_base/pytorch_model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:16cd0891233cfee3c11215a7b87306f160f7e7f3f52091a6253751c149a8c180
|
3 |
+
size 1300760949
|
models/MFR/unimernet_base/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
models/MFR/unimernet_base/tokenizer_config.json
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[START_REF]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"5": {
|
44 |
+
"content": "[END_REF]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"6": {
|
52 |
+
"content": "[IMAGE]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"7": {
|
60 |
+
"content": "<fragments>",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
},
|
67 |
+
"8": {
|
68 |
+
"content": "</fragments>",
|
69 |
+
"lstrip": false,
|
70 |
+
"normalized": false,
|
71 |
+
"rstrip": false,
|
72 |
+
"single_word": false,
|
73 |
+
"special": true
|
74 |
+
},
|
75 |
+
"9": {
|
76 |
+
"content": "<work>",
|
77 |
+
"lstrip": false,
|
78 |
+
"normalized": false,
|
79 |
+
"rstrip": false,
|
80 |
+
"single_word": false,
|
81 |
+
"special": true
|
82 |
+
},
|
83 |
+
"10": {
|
84 |
+
"content": "</work>",
|
85 |
+
"lstrip": false,
|
86 |
+
"normalized": false,
|
87 |
+
"rstrip": false,
|
88 |
+
"single_word": false,
|
89 |
+
"special": true
|
90 |
+
},
|
91 |
+
"11": {
|
92 |
+
"content": "[START_SUP]",
|
93 |
+
"lstrip": false,
|
94 |
+
"normalized": false,
|
95 |
+
"rstrip": false,
|
96 |
+
"single_word": false,
|
97 |
+
"special": true
|
98 |
+
},
|
99 |
+
"12": {
|
100 |
+
"content": "[END_SUP]",
|
101 |
+
"lstrip": false,
|
102 |
+
"normalized": false,
|
103 |
+
"rstrip": false,
|
104 |
+
"single_word": false,
|
105 |
+
"special": true
|
106 |
+
},
|
107 |
+
"13": {
|
108 |
+
"content": "[START_SUB]",
|
109 |
+
"lstrip": false,
|
110 |
+
"normalized": false,
|
111 |
+
"rstrip": false,
|
112 |
+
"single_word": false,
|
113 |
+
"special": true
|
114 |
+
},
|
115 |
+
"14": {
|
116 |
+
"content": "[END_SUB]",
|
117 |
+
"lstrip": false,
|
118 |
+
"normalized": false,
|
119 |
+
"rstrip": false,
|
120 |
+
"single_word": false,
|
121 |
+
"special": true
|
122 |
+
},
|
123 |
+
"15": {
|
124 |
+
"content": "[START_DNA]",
|
125 |
+
"lstrip": false,
|
126 |
+
"normalized": false,
|
127 |
+
"rstrip": false,
|
128 |
+
"single_word": false,
|
129 |
+
"special": true
|
130 |
+
},
|
131 |
+
"16": {
|
132 |
+
"content": "[END_DNA]",
|
133 |
+
"lstrip": false,
|
134 |
+
"normalized": false,
|
135 |
+
"rstrip": false,
|
136 |
+
"single_word": false,
|
137 |
+
"special": true
|
138 |
+
},
|
139 |
+
"17": {
|
140 |
+
"content": "[START_AMINO]",
|
141 |
+
"lstrip": false,
|
142 |
+
"normalized": false,
|
143 |
+
"rstrip": false,
|
144 |
+
"single_word": false,
|
145 |
+
"special": true
|
146 |
+
},
|
147 |
+
"18": {
|
148 |
+
"content": "[END_AMINO]",
|
149 |
+
"lstrip": false,
|
150 |
+
"normalized": false,
|
151 |
+
"rstrip": false,
|
152 |
+
"single_word": false,
|
153 |
+
"special": true
|
154 |
+
},
|
155 |
+
"19": {
|
156 |
+
"content": "[START_SMILES]",
|
157 |
+
"lstrip": false,
|
158 |
+
"normalized": false,
|
159 |
+
"rstrip": false,
|
160 |
+
"single_word": false,
|
161 |
+
"special": true
|
162 |
+
},
|
163 |
+
"20": {
|
164 |
+
"content": "[END_SMILES]",
|
165 |
+
"lstrip": false,
|
166 |
+
"normalized": false,
|
167 |
+
"rstrip": false,
|
168 |
+
"single_word": false,
|
169 |
+
"special": true
|
170 |
+
},
|
171 |
+
"21": {
|
172 |
+
"content": "[START_I_SMILES]",
|
173 |
+
"lstrip": false,
|
174 |
+
"normalized": false,
|
175 |
+
"rstrip": false,
|
176 |
+
"single_word": false,
|
177 |
+
"special": true
|
178 |
+
},
|
179 |
+
"22": {
|
180 |
+
"content": "[END_I_SMILES]",
|
181 |
+
"lstrip": false,
|
182 |
+
"normalized": false,
|
183 |
+
"rstrip": false,
|
184 |
+
"single_word": false,
|
185 |
+
"special": true
|
186 |
+
}
|
187 |
+
},
|
188 |
+
"additional_special_tokens": [],
|
189 |
+
"bos_token": "<s>",
|
190 |
+
"clean_up_tokenization_spaces": false,
|
191 |
+
"eos_token": "</s>",
|
192 |
+
"max_length": 4096,
|
193 |
+
"model_max_length": 768,
|
194 |
+
"pad_to_multiple_of": null,
|
195 |
+
"pad_token": "<pad>",
|
196 |
+
"pad_token_type_id": 0,
|
197 |
+
"padding_side": "right",
|
198 |
+
"processor_class": "VariableDonutProcessor",
|
199 |
+
"stride": 0,
|
200 |
+
"tokenizer_class": "NougatTokenizer",
|
201 |
+
"truncation_side": "right",
|
202 |
+
"truncation_strategy": "longest_first",
|
203 |
+
"unk_token": "<unk>",
|
204 |
+
"vocab_file": null
|
205 |
+
}
|
models/MFR/unimernet_base/unimernet_base.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
arch: unimernet
|
3 |
+
model_type: unimernet
|
4 |
+
model_config:
|
5 |
+
model_name: ./models/unimernet_base
|
6 |
+
max_seq_len: 1536
|
7 |
+
|
8 |
+
load_pretrained: True
|
9 |
+
pretrained: './models/unimernet_base/pytorch_model.pth'
|
10 |
+
tokenizer_config:
|
11 |
+
path: ./models/unimernet_base
|
12 |
+
|
13 |
+
datasets:
|
14 |
+
formula_rec_eval:
|
15 |
+
vis_processor:
|
16 |
+
eval:
|
17 |
+
name: "formula_image_eval"
|
18 |
+
image_size:
|
19 |
+
- 192
|
20 |
+
- 672
|
21 |
+
|
22 |
+
run:
|
23 |
+
runner: runner_iter
|
24 |
+
task: unimernet_train
|
25 |
+
|
26 |
+
batch_size_train: 64
|
27 |
+
batch_size_eval: 64
|
28 |
+
num_workers: 1
|
29 |
+
|
30 |
+
iters_per_inner_epoch: 2000
|
31 |
+
max_iters: 60000
|
32 |
+
|
33 |
+
seed: 42
|
34 |
+
output_dir: "../output/demo"
|
35 |
+
|
36 |
+
evaluate: True
|
37 |
+
test_splits: [ "eval" ]
|
38 |
+
|
39 |
+
device: "cuda"
|
40 |
+
world_size: 1
|
41 |
+
dist_url: "env://"
|
42 |
+
distributed: True
|
43 |
+
distributed_type: ddp # or fsdp when train llm
|
44 |
+
|
45 |
+
generate_cfg:
|
46 |
+
temperature: 0.0
|
models/MFR/unimernet_small/.mdl
ADDED
Binary file (48 Bytes). View file
|
|
models/MFR/unimernet_small/.msc
ADDED
Binary file (524 Bytes). View file
|
|
models/MFR/unimernet_small/.mv
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Revision:master,CreatedAt:1725608428
|
models/MFR/unimernet_small/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
## UniMERNet: A Universal Network for Mathematical Expression Recognition in Real-World Scenarios.
|
5 |
+
|
6 |
+
Visit our GitHub repository at [UniMERNet](https://github.com/opendatalab/unimernet) for more information.
|
7 |
+
|
8 |
+
|
9 |
+
## 引用
|
10 |
+
```
|
11 |
+
@misc{wang2024unimernetuniversalnetworkrealworld,
|
12 |
+
title={UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition},
|
13 |
+
author={Bin Wang and Zhuangcheng Gu and Guang Liang and Chao Xu and Bo Zhang and Botian Shi and Conghui He},
|
14 |
+
year={2024},
|
15 |
+
eprint={2404.15254},
|
16 |
+
archivePrefix={arXiv},
|
17 |
+
primaryClass={cs.CV},
|
18 |
+
url={https://arxiv.org/abs/2404.15254},
|
19 |
+
}
|
20 |
+
|
21 |
+
@misc{wang2024cdmreliablemetricfair,
|
22 |
+
title={CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation},
|
23 |
+
author={Bin Wang and Fan Wu and Linke Ouyang and Zhuangcheng Gu and Rui Zhang and Renqiu Xia and Bo Zhang and Conghui He},
|
24 |
+
year={2024},
|
25 |
+
eprint={2409.03643},
|
26 |
+
archivePrefix={arXiv},
|
27 |
+
primaryClass={cs.CV},
|
28 |
+
url={https://arxiv.org/abs/2409.03643},
|
29 |
+
}
|
30 |
+
|
31 |
+
@misc{he2024opendatalabempoweringgeneralartificial,
|
32 |
+
title={OpenDataLab: Empowering General Artificial Intelligence with Open Datasets},
|
33 |
+
author={Conghui He and Wei Li and Zhenjiang Jin and Chao Xu and Bin Wang and Dahua Lin},
|
34 |
+
year={2024},
|
35 |
+
eprint={2407.13773},
|
36 |
+
archivePrefix={arXiv},
|
37 |
+
primaryClass={cs.DL},
|
38 |
+
url={https://arxiv.org/abs/2407.13773},
|
39 |
+
}
|
40 |
+
```
|
41 |
+
|
42 |
+
## MD5 checksums
|
43 |
+
```
|
44 |
+
97f4867b4ff4e9a96c8daba8aaa793b4 tokenizer_config.json
|
45 |
+
351652071425d3d36a634ccc8efb22e8 tokenizer.json
|
46 |
+
430e426354e71624fb096c5c7ad90a78 pytorch_model.pth
|
47 |
+
```
|
models/MFR/unimernet_small/config.json
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "unimernet/checkpoint-300000",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "gelu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"add_final_layer_norm": true,
|
12 |
+
"architectures": null,
|
13 |
+
"attention_dropout": 0.0,
|
14 |
+
"bad_words_ids": null,
|
15 |
+
"begin_suppress_tokens": null,
|
16 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"classifier_dropout": 0.0,
|
19 |
+
"cross_attention_hidden_size": null,
|
20 |
+
"d_model": 768,
|
21 |
+
"decoder_attention_heads": 16,
|
22 |
+
"decoder_ffn_dim": 3072,
|
23 |
+
"decoder_layerdrop": 0.0,
|
24 |
+
"decoder_layers": 8,
|
25 |
+
"decoder_start_token_id": null,
|
26 |
+
"diversity_penalty": 0.0,
|
27 |
+
"do_sample": false,
|
28 |
+
"dropout": 0.1,
|
29 |
+
"early_stopping": false,
|
30 |
+
"encoder_attention_heads": 16,
|
31 |
+
"encoder_ffn_dim": 3072,
|
32 |
+
"encoder_layerdrop": 0.0,
|
33 |
+
"encoder_layers": 12,
|
34 |
+
"encoder_no_repeat_ngram_size": 0,
|
35 |
+
"eos_token_id": 2,
|
36 |
+
"exponential_decay_length_penalty": null,
|
37 |
+
"finetuning_task": null,
|
38 |
+
"forced_bos_token_id": null,
|
39 |
+
"forced_eos_token_id": 2,
|
40 |
+
"id2label": {
|
41 |
+
"0": "LABEL_0",
|
42 |
+
"1": "LABEL_1"
|
43 |
+
},
|
44 |
+
"init_std": 0.02,
|
45 |
+
"is_decoder": true,
|
46 |
+
"is_encoder_decoder": false,
|
47 |
+
"label2id": {
|
48 |
+
"LABEL_0": 0,
|
49 |
+
"LABEL_1": 1
|
50 |
+
},
|
51 |
+
"length_penalty": 1.0,
|
52 |
+
"max_length": 20,
|
53 |
+
"max_position_embeddings": 1536,
|
54 |
+
"min_length": 0,
|
55 |
+
"model_type": "mbart",
|
56 |
+
"no_repeat_ngram_size": 0,
|
57 |
+
"num_beam_groups": 1,
|
58 |
+
"num_beams": 1,
|
59 |
+
"num_hidden_layers": 12,
|
60 |
+
"num_return_sequences": 1,
|
61 |
+
"output_attentions": false,
|
62 |
+
"output_hidden_states": false,
|
63 |
+
"output_scores": false,
|
64 |
+
"pad_token_id": 1,
|
65 |
+
"prefix": null,
|
66 |
+
"problem_type": null,
|
67 |
+
"pruned_heads": {},
|
68 |
+
"remove_invalid_values": false,
|
69 |
+
"repetition_penalty": 1.0,
|
70 |
+
"return_dict": true,
|
71 |
+
"return_dict_in_generate": false,
|
72 |
+
"scale_embedding": true,
|
73 |
+
"sep_token_id": null,
|
74 |
+
"suppress_tokens": null,
|
75 |
+
"task_specific_params": null,
|
76 |
+
"temperature": 1.0,
|
77 |
+
"tf_legacy_loss": false,
|
78 |
+
"tie_encoder_decoder": false,
|
79 |
+
"tie_word_embeddings": false,
|
80 |
+
"tokenizer_class": null,
|
81 |
+
"top_k": 50,
|
82 |
+
"top_p": 1.0,
|
83 |
+
"torch_dtype": null,
|
84 |
+
"torchscript": false,
|
85 |
+
"typical_p": 1.0,
|
86 |
+
"use_bfloat16": false,
|
87 |
+
"use_cache": true,
|
88 |
+
"vocab_size": 50000
|
89 |
+
},
|
90 |
+
"decoder_start_token_id": 0,
|
91 |
+
"encoder": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_probs_dropout_prob": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"begin_suppress_tokens": null,
|
98 |
+
"bos_token_id": null,
|
99 |
+
"chunk_size_feed_forward": 0,
|
100 |
+
"cross_attention_hidden_size": null,
|
101 |
+
"decoder_start_token_id": null,
|
102 |
+
"depths": [
|
103 |
+
6,
|
104 |
+
6,
|
105 |
+
6,
|
106 |
+
6
|
107 |
+
],
|
108 |
+
"diversity_penalty": 0.0,
|
109 |
+
"do_sample": false,
|
110 |
+
"drop_path_rate": 0.1,
|
111 |
+
"early_stopping": false,
|
112 |
+
"embed_dim": 96,
|
113 |
+
"encoder_no_repeat_ngram_size": 0,
|
114 |
+
"eos_token_id": null,
|
115 |
+
"exponential_decay_length_penalty": null,
|
116 |
+
"finetuning_task": null,
|
117 |
+
"forced_bos_token_id": null,
|
118 |
+
"forced_eos_token_id": null,
|
119 |
+
"hidden_act": "gelu",
|
120 |
+
"hidden_dropout_prob": 0.0,
|
121 |
+
"hidden_size": 768,
|
122 |
+
"id2label": {
|
123 |
+
"0": "LABEL_0",
|
124 |
+
"1": "LABEL_1"
|
125 |
+
},
|
126 |
+
"image_size": [
|
127 |
+
420,
|
128 |
+
420
|
129 |
+
],
|
130 |
+
"initializer_range": 0.02,
|
131 |
+
"is_decoder": false,
|
132 |
+
"is_encoder_decoder": false,
|
133 |
+
"label2id": {
|
134 |
+
"LABEL_0": 0,
|
135 |
+
"LABEL_1": 1
|
136 |
+
},
|
137 |
+
"layer_norm_eps": 1e-05,
|
138 |
+
"length_penalty": 1.0,
|
139 |
+
"max_length": 20,
|
140 |
+
"min_length": 0,
|
141 |
+
"mlp_ratio": 4.0,
|
142 |
+
"model_type": "donut-swin",
|
143 |
+
"no_repeat_ngram_size": 0,
|
144 |
+
"num_beam_groups": 1,
|
145 |
+
"num_beams": 1,
|
146 |
+
"num_channels": 3,
|
147 |
+
"num_heads": [
|
148 |
+
3,
|
149 |
+
6,
|
150 |
+
12,
|
151 |
+
24
|
152 |
+
],
|
153 |
+
"num_layers": 4,
|
154 |
+
"num_return_sequences": 1,
|
155 |
+
"output_attentions": false,
|
156 |
+
"output_hidden_states": false,
|
157 |
+
"output_scores": false,
|
158 |
+
"pad_token_id": null,
|
159 |
+
"patch_size": 4,
|
160 |
+
"path_norm": true,
|
161 |
+
"prefix": null,
|
162 |
+
"problem_type": null,
|
163 |
+
"pruned_heads": {},
|
164 |
+
"qkv_bias": true,
|
165 |
+
"remove_invalid_values": false,
|
166 |
+
"repetition_penalty": 1.0,
|
167 |
+
"return_dict": true,
|
168 |
+
"return_dict_in_generate": false,
|
169 |
+
"sep_token_id": null,
|
170 |
+
"suppress_tokens": null,
|
171 |
+
"task_specific_params": null,
|
172 |
+
"temperature": 1.0,
|
173 |
+
"tf_legacy_loss": false,
|
174 |
+
"tie_encoder_decoder": false,
|
175 |
+
"tie_word_embeddings": true,
|
176 |
+
"tokenizer_class": null,
|
177 |
+
"top_k": 50,
|
178 |
+
"top_p": 1.0,
|
179 |
+
"torch_dtype": null,
|
180 |
+
"torchscript": false,
|
181 |
+
"typical_p": 1.0,
|
182 |
+
"use_2d_embeddings": false,
|
183 |
+
"use_absolute_embeddings": false,
|
184 |
+
"use_bfloat16": false,
|
185 |
+
"window_size": 5
|
186 |
+
},
|
187 |
+
"is_encoder_decoder": true,
|
188 |
+
"model_type": "vision-encoder-decoder",
|
189 |
+
"pad_token_id": 1,
|
190 |
+
"tie_word_embeddings": false,
|
191 |
+
"torch_dtype": "float16",
|
192 |
+
"transformers_version": "4.36.0"
|
193 |
+
}
|
models/MFR/unimernet_small/configuration.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"framework":"Pytorch","task":"ocr-recognition"}
|
models/MFR/unimernet_small/preprocessor_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_align_long_axis": false,
|
3 |
+
"do_normalize": false,
|
4 |
+
"do_pad": false,
|
5 |
+
"do_rescale": false,
|
6 |
+
"do_resize": false,
|
7 |
+
"do_thumbnail": false,
|
8 |
+
"feature_extractor_type": "DonutFeatureExtractor",
|
9 |
+
"image_mean": [
|
10 |
+
0.485,
|
11 |
+
0.456,
|
12 |
+
0.406
|
13 |
+
],
|
14 |
+
"image_processor_type": "VariableDonutImageProcessor",
|
15 |
+
"image_std": [
|
16 |
+
0.229,
|
17 |
+
0.224,
|
18 |
+
0.225
|
19 |
+
],
|
20 |
+
"max_size": {
|
21 |
+
"height": 192,
|
22 |
+
"width": 672
|
23 |
+
},
|
24 |
+
"patch_size": [
|
25 |
+
4,
|
26 |
+
4
|
27 |
+
],
|
28 |
+
"processor_class": "VariableDonutProcessor",
|
29 |
+
"resample": 2,
|
30 |
+
"rescale_factor": 0.00392156862745098,
|
31 |
+
"size": [
|
32 |
+
192,
|
33 |
+
672
|
34 |
+
],
|
35 |
+
"train": false
|
36 |
+
}
|
models/MFR/unimernet_small/pytorch_model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa54b0a8126bb60060bc90818ce20a5ca1b5dd5d7da5c0983579f5c3a2cc90ea
|
3 |
+
size 810284404
|
models/MFR/unimernet_small/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
models/MFR/unimernet_small/tokenizer_config.json
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[START_REF]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"5": {
|
44 |
+
"content": "[END_REF]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"6": {
|
52 |
+
"content": "[IMAGE]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"7": {
|
60 |
+
"content": "<fragments>",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
},
|
67 |
+
"8": {
|
68 |
+
"content": "</fragments>",
|
69 |
+
"lstrip": false,
|
70 |
+
"normalized": false,
|
71 |
+
"rstrip": false,
|
72 |
+
"single_word": false,
|
73 |
+
"special": true
|
74 |
+
},
|
75 |
+
"9": {
|
76 |
+
"content": "<work>",
|
77 |
+
"lstrip": false,
|
78 |
+
"normalized": false,
|
79 |
+
"rstrip": false,
|
80 |
+
"single_word": false,
|
81 |
+
"special": true
|
82 |
+
},
|
83 |
+
"10": {
|
84 |
+
"content": "</work>",
|
85 |
+
"lstrip": false,
|
86 |
+
"normalized": false,
|
87 |
+
"rstrip": false,
|
88 |
+
"single_word": false,
|
89 |
+
"special": true
|
90 |
+
},
|
91 |
+
"11": {
|
92 |
+
"content": "[START_SUP]",
|
93 |
+
"lstrip": false,
|
94 |
+
"normalized": false,
|
95 |
+
"rstrip": false,
|
96 |
+
"single_word": false,
|
97 |
+
"special": true
|
98 |
+
},
|
99 |
+
"12": {
|
100 |
+
"content": "[END_SUP]",
|
101 |
+
"lstrip": false,
|
102 |
+
"normalized": false,
|
103 |
+
"rstrip": false,
|
104 |
+
"single_word": false,
|
105 |
+
"special": true
|
106 |
+
},
|
107 |
+
"13": {
|
108 |
+
"content": "[START_SUB]",
|
109 |
+
"lstrip": false,
|
110 |
+
"normalized": false,
|
111 |
+
"rstrip": false,
|
112 |
+
"single_word": false,
|
113 |
+
"special": true
|
114 |
+
},
|
115 |
+
"14": {
|
116 |
+
"content": "[END_SUB]",
|
117 |
+
"lstrip": false,
|
118 |
+
"normalized": false,
|
119 |
+
"rstrip": false,
|
120 |
+
"single_word": false,
|
121 |
+
"special": true
|
122 |
+
},
|
123 |
+
"15": {
|
124 |
+
"content": "[START_DNA]",
|
125 |
+
"lstrip": false,
|
126 |
+
"normalized": false,
|
127 |
+
"rstrip": false,
|
128 |
+
"single_word": false,
|
129 |
+
"special": true
|
130 |
+
},
|
131 |
+
"16": {
|
132 |
+
"content": "[END_DNA]",
|
133 |
+
"lstrip": false,
|
134 |
+
"normalized": false,
|
135 |
+
"rstrip": false,
|
136 |
+
"single_word": false,
|
137 |
+
"special": true
|
138 |
+
},
|
139 |
+
"17": {
|
140 |
+
"content": "[START_AMINO]",
|
141 |
+
"lstrip": false,
|
142 |
+
"normalized": false,
|
143 |
+
"rstrip": false,
|
144 |
+
"single_word": false,
|
145 |
+
"special": true
|
146 |
+
},
|
147 |
+
"18": {
|
148 |
+
"content": "[END_AMINO]",
|
149 |
+
"lstrip": false,
|
150 |
+
"normalized": false,
|
151 |
+
"rstrip": false,
|
152 |
+
"single_word": false,
|
153 |
+
"special": true
|
154 |
+
},
|
155 |
+
"19": {
|
156 |
+
"content": "[START_SMILES]",
|
157 |
+
"lstrip": false,
|
158 |
+
"normalized": false,
|
159 |
+
"rstrip": false,
|
160 |
+
"single_word": false,
|
161 |
+
"special": true
|
162 |
+
},
|
163 |
+
"20": {
|
164 |
+
"content": "[END_SMILES]",
|
165 |
+
"lstrip": false,
|
166 |
+
"normalized": false,
|
167 |
+
"rstrip": false,
|
168 |
+
"single_word": false,
|
169 |
+
"special": true
|
170 |
+
},
|
171 |
+
"21": {
|
172 |
+
"content": "[START_I_SMILES]",
|
173 |
+
"lstrip": false,
|
174 |
+
"normalized": false,
|
175 |
+
"rstrip": false,
|
176 |
+
"single_word": false,
|
177 |
+
"special": true
|
178 |
+
},
|
179 |
+
"22": {
|
180 |
+
"content": "[END_I_SMILES]",
|
181 |
+
"lstrip": false,
|
182 |
+
"normalized": false,
|
183 |
+
"rstrip": false,
|
184 |
+
"single_word": false,
|
185 |
+
"special": true
|
186 |
+
}
|
187 |
+
},
|
188 |
+
"additional_special_tokens": [],
|
189 |
+
"bos_token": "<s>",
|
190 |
+
"clean_up_tokenization_spaces": false,
|
191 |
+
"eos_token": "</s>",
|
192 |
+
"max_length": 4096,
|
193 |
+
"model_max_length": 768,
|
194 |
+
"pad_to_multiple_of": null,
|
195 |
+
"pad_token": "<pad>",
|
196 |
+
"pad_token_type_id": 0,
|
197 |
+
"padding_side": "right",
|
198 |
+
"processor_class": "VariableDonutProcessor",
|
199 |
+
"stride": 0,
|
200 |
+
"tokenizer_class": "NougatTokenizer",
|
201 |
+
"truncation_side": "right",
|
202 |
+
"truncation_strategy": "longest_first",
|
203 |
+
"unk_token": "<unk>",
|
204 |
+
"vocab_file": null
|
205 |
+
}
|
models/MFR/unimernet_small/unimernet_small.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
arch: unimernet
|
3 |
+
model_type: unimernet
|
4 |
+
model_config:
|
5 |
+
model_name: ./models/unimernet_small
|
6 |
+
max_seq_len: 1536
|
7 |
+
|
8 |
+
load_pretrained: True
|
9 |
+
pretrained: './models/unimernet_small/pytorch_model.pth'
|
10 |
+
tokenizer_config:
|
11 |
+
path: ./models/unimernet_small
|
12 |
+
|
13 |
+
datasets:
|
14 |
+
formula_rec_eval:
|
15 |
+
vis_processor:
|
16 |
+
eval:
|
17 |
+
name: "formula_image_eval"
|
18 |
+
image_size:
|
19 |
+
- 192
|
20 |
+
- 672
|
21 |
+
|
22 |
+
run:
|
23 |
+
runner: runner_iter
|
24 |
+
task: unimernet_train
|
25 |
+
|
26 |
+
batch_size_train: 64
|
27 |
+
batch_size_eval: 64
|
28 |
+
num_workers: 1
|
29 |
+
|
30 |
+
iters_per_inner_epoch: 2000
|
31 |
+
max_iters: 60000
|
32 |
+
|
33 |
+
seed: 42
|
34 |
+
output_dir: "../output/demo"
|
35 |
+
|
36 |
+
evaluate: True
|
37 |
+
test_splits: [ "eval" ]
|
38 |
+
|
39 |
+
device: "cuda"
|
40 |
+
world_size: 1
|
41 |
+
dist_url: "env://"
|
42 |
+
distributed: True
|
43 |
+
distributed_type: ddp # or fsdp when train llm
|
44 |
+
|
45 |
+
generate_cfg:
|
46 |
+
temperature: 0.0
|
models/MFR/unimernet_tiny/.mdl
ADDED
Binary file (47 Bytes). View file
|
|
models/MFR/unimernet_tiny/.msc
ADDED
Binary file (523 Bytes). View file
|
|
models/MFR/unimernet_tiny/.mv
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Revision:master,CreatedAt:1725608470
|
models/MFR/unimernet_tiny/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
## UniMERNet: A Universal Network for Mathematical Expression Recognition in Real-World Scenarios.
|
5 |
+
|
6 |
+
Visit our GitHub repository at [UniMERNet](https://github.com/opendatalab/unimernet) for more information.
|
7 |
+
|
8 |
+
|
9 |
+
## 引用
|
10 |
+
```
|
11 |
+
@misc{wang2024unimernetuniversalnetworkrealworld,
|
12 |
+
title={UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition},
|
13 |
+
author={Bin Wang and Zhuangcheng Gu and Guang Liang and Chao Xu and Bo Zhang and Botian Shi and Conghui He},
|
14 |
+
year={2024},
|
15 |
+
eprint={2404.15254},
|
16 |
+
archivePrefix={arXiv},
|
17 |
+
primaryClass={cs.CV},
|
18 |
+
url={https://arxiv.org/abs/2404.15254},
|
19 |
+
}
|
20 |
+
|
21 |
+
@misc{wang2024cdmreliablemetricfair,
|
22 |
+
title={CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation},
|
23 |
+
author={Bin Wang and Fan Wu and Linke Ouyang and Zhuangcheng Gu and Rui Zhang and Renqiu Xia and Bo Zhang and Conghui He},
|
24 |
+
year={2024},
|
25 |
+
eprint={2409.03643},
|
26 |
+
archivePrefix={arXiv},
|
27 |
+
primaryClass={cs.CV},
|
28 |
+
url={https://arxiv.org/abs/2409.03643},
|
29 |
+
}
|
30 |
+
|
31 |
+
@misc{he2024opendatalabempoweringgeneralartificial,
|
32 |
+
title={OpenDataLab: Empowering General Artificial Intelligence with Open Datasets},
|
33 |
+
author={Conghui He and Wei Li and Zhenjiang Jin and Chao Xu and Bin Wang and Dahua Lin},
|
34 |
+
year={2024},
|
35 |
+
eprint={2407.13773},
|
36 |
+
archivePrefix={arXiv},
|
37 |
+
primaryClass={cs.DL},
|
38 |
+
url={https://arxiv.org/abs/2407.13773},
|
39 |
+
}
|
40 |
+
```
|
41 |
+
```
|
42 |
+
|
43 |
+
## MD5 checksums
|
44 |
+
```
|
45 |
+
97f4867b4ff4e9a96c8daba8aaa793b4 tokenizer_config.json
|
46 |
+
351652071425d3d36a634ccc8efb22e8 tokenizer.json
|
47 |
+
72b53a2152af43a57f8d5eebf8e31562 pytorch_model.pth
|
48 |
+
```
|
models/MFR/unimernet_tiny/config.json
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "unimernet/checkpoint-300000",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "gelu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"add_final_layer_norm": true,
|
12 |
+
"architectures": null,
|
13 |
+
"attention_dropout": 0.0,
|
14 |
+
"bad_words_ids": null,
|
15 |
+
"begin_suppress_tokens": null,
|
16 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"classifier_dropout": 0.0,
|
19 |
+
"cross_attention_hidden_size": null,
|
20 |
+
"d_model": 512,
|
21 |
+
"decoder_attention_heads": 16,
|
22 |
+
"decoder_ffn_dim": 2048,
|
23 |
+
"decoder_layerdrop": 0.0,
|
24 |
+
"decoder_layers": 8,
|
25 |
+
"decoder_start_token_id": null,
|
26 |
+
"diversity_penalty": 0.0,
|
27 |
+
"do_sample": false,
|
28 |
+
"dropout": 0.1,
|
29 |
+
"early_stopping": false,
|
30 |
+
"encoder_attention_heads": 16,
|
31 |
+
"encoder_ffn_dim": 2048,
|
32 |
+
"encoder_layerdrop": 0.0,
|
33 |
+
"encoder_layers": 12,
|
34 |
+
"encoder_no_repeat_ngram_size": 0,
|
35 |
+
"eos_token_id": 2,
|
36 |
+
"exponential_decay_length_penalty": null,
|
37 |
+
"finetuning_task": null,
|
38 |
+
"forced_bos_token_id": null,
|
39 |
+
"forced_eos_token_id": 2,
|
40 |
+
"id2label": {
|
41 |
+
"0": "LABEL_0",
|
42 |
+
"1": "LABEL_1"
|
43 |
+
},
|
44 |
+
"init_std": 0.02,
|
45 |
+
"is_decoder": true,
|
46 |
+
"is_encoder_decoder": false,
|
47 |
+
"label2id": {
|
48 |
+
"LABEL_0": 0,
|
49 |
+
"LABEL_1": 1
|
50 |
+
},
|
51 |
+
"length_penalty": 1.0,
|
52 |
+
"max_length": 20,
|
53 |
+
"max_position_embeddings": 1536,
|
54 |
+
"min_length": 0,
|
55 |
+
"model_type": "mbart",
|
56 |
+
"no_repeat_ngram_size": 0,
|
57 |
+
"num_beam_groups": 1,
|
58 |
+
"num_beams": 1,
|
59 |
+
"num_hidden_layers": 12,
|
60 |
+
"num_return_sequences": 1,
|
61 |
+
"output_attentions": false,
|
62 |
+
"output_hidden_states": false,
|
63 |
+
"output_scores": false,
|
64 |
+
"pad_token_id": 1,
|
65 |
+
"prefix": null,
|
66 |
+
"problem_type": null,
|
67 |
+
"pruned_heads": {},
|
68 |
+
"remove_invalid_values": false,
|
69 |
+
"repetition_penalty": 1.0,
|
70 |
+
"return_dict": true,
|
71 |
+
"return_dict_in_generate": false,
|
72 |
+
"scale_embedding": true,
|
73 |
+
"sep_token_id": null,
|
74 |
+
"suppress_tokens": null,
|
75 |
+
"task_specific_params": null,
|
76 |
+
"temperature": 1.0,
|
77 |
+
"tf_legacy_loss": false,
|
78 |
+
"tie_encoder_decoder": false,
|
79 |
+
"tie_word_embeddings": false,
|
80 |
+
"tokenizer_class": null,
|
81 |
+
"top_k": 50,
|
82 |
+
"top_p": 1.0,
|
83 |
+
"torch_dtype": null,
|
84 |
+
"torchscript": false,
|
85 |
+
"typical_p": 1.0,
|
86 |
+
"use_bfloat16": false,
|
87 |
+
"use_cache": true,
|
88 |
+
"vocab_size": 50000
|
89 |
+
},
|
90 |
+
"decoder_start_token_id": 0,
|
91 |
+
"encoder": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_probs_dropout_prob": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"begin_suppress_tokens": null,
|
98 |
+
"bos_token_id": null,
|
99 |
+
"chunk_size_feed_forward": 0,
|
100 |
+
"cross_attention_hidden_size": null,
|
101 |
+
"decoder_start_token_id": null,
|
102 |
+
"depths": [
|
103 |
+
6,
|
104 |
+
6,
|
105 |
+
6,
|
106 |
+
6
|
107 |
+
],
|
108 |
+
"diversity_penalty": 0.0,
|
109 |
+
"do_sample": false,
|
110 |
+
"drop_path_rate": 0.1,
|
111 |
+
"early_stopping": false,
|
112 |
+
"embed_dim": 64,
|
113 |
+
"encoder_no_repeat_ngram_size": 0,
|
114 |
+
"eos_token_id": null,
|
115 |
+
"exponential_decay_length_penalty": null,
|
116 |
+
"finetuning_task": null,
|
117 |
+
"forced_bos_token_id": null,
|
118 |
+
"forced_eos_token_id": null,
|
119 |
+
"hidden_act": "gelu",
|
120 |
+
"hidden_dropout_prob": 0.0,
|
121 |
+
"hidden_size": 512,
|
122 |
+
"id2label": {
|
123 |
+
"0": "LABEL_0",
|
124 |
+
"1": "LABEL_1"
|
125 |
+
},
|
126 |
+
"image_size": [
|
127 |
+
420,
|
128 |
+
420
|
129 |
+
],
|
130 |
+
"initializer_range": 0.02,
|
131 |
+
"is_decoder": false,
|
132 |
+
"is_encoder_decoder": false,
|
133 |
+
"label2id": {
|
134 |
+
"LABEL_0": 0,
|
135 |
+
"LABEL_1": 1
|
136 |
+
},
|
137 |
+
"layer_norm_eps": 1e-05,
|
138 |
+
"length_penalty": 1.0,
|
139 |
+
"max_length": 20,
|
140 |
+
"min_length": 0,
|
141 |
+
"mlp_ratio": 4.0,
|
142 |
+
"model_type": "donut-swin",
|
143 |
+
"no_repeat_ngram_size": 0,
|
144 |
+
"num_beam_groups": 1,
|
145 |
+
"num_beams": 1,
|
146 |
+
"num_channels": 3,
|
147 |
+
"num_heads": [
|
148 |
+
2,
|
149 |
+
4,
|
150 |
+
8,
|
151 |
+
16
|
152 |
+
],
|
153 |
+
"num_layers": 4,
|
154 |
+
"num_return_sequences": 1,
|
155 |
+
"output_attentions": false,
|
156 |
+
"output_hidden_states": false,
|
157 |
+
"output_scores": false,
|
158 |
+
"pad_token_id": null,
|
159 |
+
"patch_size": 4,
|
160 |
+
"path_norm": true,
|
161 |
+
"prefix": null,
|
162 |
+
"problem_type": null,
|
163 |
+
"pruned_heads": {},
|
164 |
+
"qkv_bias": true,
|
165 |
+
"remove_invalid_values": false,
|
166 |
+
"repetition_penalty": 1.0,
|
167 |
+
"return_dict": true,
|
168 |
+
"return_dict_in_generate": false,
|
169 |
+
"sep_token_id": null,
|
170 |
+
"suppress_tokens": null,
|
171 |
+
"task_specific_params": null,
|
172 |
+
"temperature": 1.0,
|
173 |
+
"tf_legacy_loss": false,
|
174 |
+
"tie_encoder_decoder": false,
|
175 |
+
"tie_word_embeddings": true,
|
176 |
+
"tokenizer_class": null,
|
177 |
+
"top_k": 50,
|
178 |
+
"top_p": 1.0,
|
179 |
+
"torch_dtype": null,
|
180 |
+
"torchscript": false,
|
181 |
+
"typical_p": 1.0,
|
182 |
+
"use_2d_embeddings": false,
|
183 |
+
"use_absolute_embeddings": false,
|
184 |
+
"use_bfloat16": false,
|
185 |
+
"window_size": 5
|
186 |
+
},
|
187 |
+
"is_encoder_decoder": true,
|
188 |
+
"model_type": "vision-encoder-decoder",
|
189 |
+
"pad_token_id": 1,
|
190 |
+
"tie_word_embeddings": false,
|
191 |
+
"torch_dtype": "float16",
|
192 |
+
"transformers_version": "4.36.0"
|
193 |
+
}
|
models/MFR/unimernet_tiny/configuration.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"framework":"Pytorch","task":"ocr-recognition"}
|
models/MFR/unimernet_tiny/preprocessor_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_align_long_axis": false,
|
3 |
+
"do_normalize": false,
|
4 |
+
"do_pad": false,
|
5 |
+
"do_rescale": false,
|
6 |
+
"do_resize": false,
|
7 |
+
"do_thumbnail": false,
|
8 |
+
"feature_extractor_type": "DonutFeatureExtractor",
|
9 |
+
"image_mean": [
|
10 |
+
0.485,
|
11 |
+
0.456,
|
12 |
+
0.406
|
13 |
+
],
|
14 |
+
"image_processor_type": "VariableDonutImageProcessor",
|
15 |
+
"image_std": [
|
16 |
+
0.229,
|
17 |
+
0.224,
|
18 |
+
0.225
|
19 |
+
],
|
20 |
+
"max_size": {
|
21 |
+
"height": 192,
|
22 |
+
"width": 672
|
23 |
+
},
|
24 |
+
"patch_size": [
|
25 |
+
4,
|
26 |
+
4
|
27 |
+
],
|
28 |
+
"processor_class": "VariableDonutProcessor",
|
29 |
+
"resample": 2,
|
30 |
+
"rescale_factor": 0.00392156862745098,
|
31 |
+
"size": [
|
32 |
+
192,
|
33 |
+
672
|
34 |
+
],
|
35 |
+
"train": false
|
36 |
+
}
|
models/MFR/unimernet_tiny/pytorch_model.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f7608624e2d7549c7f0f05fcfbe073ae521328cf70f1d46374d96f9881d7371
|
3 |
+
size 430075701
|
models/MFR/unimernet_tiny/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
models/MFR/unimernet_tiny/tokenizer_config.json
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[START_REF]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"5": {
|
44 |
+
"content": "[END_REF]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"6": {
|
52 |
+
"content": "[IMAGE]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"7": {
|
60 |
+
"content": "<fragments>",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
},
|
67 |
+
"8": {
|
68 |
+
"content": "</fragments>",
|
69 |
+
"lstrip": false,
|
70 |
+
"normalized": false,
|
71 |
+
"rstrip": false,
|
72 |
+
"single_word": false,
|
73 |
+
"special": true
|
74 |
+
},
|
75 |
+
"9": {
|
76 |
+
"content": "<work>",
|
77 |
+
"lstrip": false,
|
78 |
+
"normalized": false,
|
79 |
+
"rstrip": false,
|
80 |
+
"single_word": false,
|
81 |
+
"special": true
|
82 |
+
},
|
83 |
+
"10": {
|
84 |
+
"content": "</work>",
|
85 |
+
"lstrip": false,
|
86 |
+
"normalized": false,
|
87 |
+
"rstrip": false,
|
88 |
+
"single_word": false,
|
89 |
+
"special": true
|
90 |
+
},
|
91 |
+
"11": {
|
92 |
+
"content": "[START_SUP]",
|
93 |
+
"lstrip": false,
|
94 |
+
"normalized": false,
|
95 |
+
"rstrip": false,
|
96 |
+
"single_word": false,
|
97 |
+
"special": true
|
98 |
+
},
|
99 |
+
"12": {
|
100 |
+
"content": "[END_SUP]",
|
101 |
+
"lstrip": false,
|
102 |
+
"normalized": false,
|
103 |
+
"rstrip": false,
|
104 |
+
"single_word": false,
|
105 |
+
"special": true
|
106 |
+
},
|
107 |
+
"13": {
|
108 |
+
"content": "[START_SUB]",
|
109 |
+
"lstrip": false,
|
110 |
+
"normalized": false,
|
111 |
+
"rstrip": false,
|
112 |
+
"single_word": false,
|
113 |
+
"special": true
|
114 |
+
},
|
115 |
+
"14": {
|
116 |
+
"content": "[END_SUB]",
|
117 |
+
"lstrip": false,
|
118 |
+
"normalized": false,
|
119 |
+
"rstrip": false,
|
120 |
+
"single_word": false,
|
121 |
+
"special": true
|
122 |
+
},
|
123 |
+
"15": {
|
124 |
+
"content": "[START_DNA]",
|
125 |
+
"lstrip": false,
|
126 |
+
"normalized": false,
|
127 |
+
"rstrip": false,
|
128 |
+
"single_word": false,
|
129 |
+
"special": true
|
130 |
+
},
|
131 |
+
"16": {
|
132 |
+
"content": "[END_DNA]",
|
133 |
+
"lstrip": false,
|
134 |
+
"normalized": false,
|
135 |
+
"rstrip": false,
|
136 |
+
"single_word": false,
|
137 |
+
"special": true
|
138 |
+
},
|
139 |
+
"17": {
|
140 |
+
"content": "[START_AMINO]",
|
141 |
+
"lstrip": false,
|
142 |
+
"normalized": false,
|
143 |
+
"rstrip": false,
|
144 |
+
"single_word": false,
|
145 |
+
"special": true
|
146 |
+
},
|
147 |
+
"18": {
|
148 |
+
"content": "[END_AMINO]",
|
149 |
+
"lstrip": false,
|
150 |
+
"normalized": false,
|
151 |
+
"rstrip": false,
|
152 |
+
"single_word": false,
|
153 |
+
"special": true
|
154 |
+
},
|
155 |
+
"19": {
|
156 |
+
"content": "[START_SMILES]",
|
157 |
+
"lstrip": false,
|
158 |
+
"normalized": false,
|
159 |
+
"rstrip": false,
|
160 |
+
"single_word": false,
|
161 |
+
"special": true
|
162 |
+
},
|
163 |
+
"20": {
|
164 |
+
"content": "[END_SMILES]",
|
165 |
+
"lstrip": false,
|
166 |
+
"normalized": false,
|
167 |
+
"rstrip": false,
|
168 |
+
"single_word": false,
|
169 |
+
"special": true
|
170 |
+
},
|
171 |
+
"21": {
|
172 |
+
"content": "[START_I_SMILES]",
|
173 |
+
"lstrip": false,
|
174 |
+
"normalized": false,
|
175 |
+
"rstrip": false,
|
176 |
+
"single_word": false,
|
177 |
+
"special": true
|
178 |
+
},
|
179 |
+
"22": {
|
180 |
+
"content": "[END_I_SMILES]",
|
181 |
+
"lstrip": false,
|
182 |
+
"normalized": false,
|
183 |
+
"rstrip": false,
|
184 |
+
"single_word": false,
|
185 |
+
"special": true
|
186 |
+
}
|
187 |
+
},
|
188 |
+
"additional_special_tokens": [],
|
189 |
+
"bos_token": "<s>",
|
190 |
+
"clean_up_tokenization_spaces": false,
|
191 |
+
"eos_token": "</s>",
|
192 |
+
"max_length": 4096,
|
193 |
+
"model_max_length": 768,
|
194 |
+
"pad_to_multiple_of": null,
|
195 |
+
"pad_token": "<pad>",
|
196 |
+
"pad_token_type_id": 0,
|
197 |
+
"padding_side": "right",
|
198 |
+
"processor_class": "VariableDonutProcessor",
|
199 |
+
"stride": 0,
|
200 |
+
"tokenizer_class": "NougatTokenizer",
|
201 |
+
"truncation_side": "right",
|
202 |
+
"truncation_strategy": "longest_first",
|
203 |
+
"unk_token": "<unk>",
|
204 |
+
"vocab_file": null
|
205 |
+
}
|
models/MFR/unimernet_tiny/unimernet_tiny.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
arch: unimernet
|
3 |
+
model_type: unimernet
|
4 |
+
model_config:
|
5 |
+
model_name: ./models/unimernet_tiny
|
6 |
+
max_seq_len: 1536
|
7 |
+
|
8 |
+
load_pretrained: True
|
9 |
+
pretrained: './models/unimernet_tiny/pytorch_model.pth'
|
10 |
+
tokenizer_config:
|
11 |
+
path: ./models/unimernet_tiny
|
12 |
+
|
13 |
+
datasets:
|
14 |
+
formula_rec_eval:
|
15 |
+
vis_processor:
|
16 |
+
eval:
|
17 |
+
name: "formula_image_eval"
|
18 |
+
image_size:
|
19 |
+
- 192
|
20 |
+
- 672
|
21 |
+
|
22 |
+
run:
|
23 |
+
runner: runner_iter
|
24 |
+
task: unimernet_train
|
25 |
+
|
26 |
+
batch_size_train: 64
|
27 |
+
batch_size_eval: 64
|
28 |
+
num_workers: 1
|
29 |
+
|
30 |
+
iters_per_inner_epoch: 2000
|
31 |
+
max_iters: 60000
|
32 |
+
|
33 |
+
seed: 42
|
34 |
+
output_dir: "../output/demo"
|
35 |
+
|
36 |
+
evaluate: True
|
37 |
+
test_splits: [ "eval" ]
|
38 |
+
|
39 |
+
device: "cuda"
|
40 |
+
world_size: 1
|
41 |
+
dist_url: "env://"
|
42 |
+
distributed: True
|
43 |
+
distributed_type: ddp # or fsdp when train llm
|
44 |
+
|
45 |
+
generate_cfg:
|
46 |
+
temperature: 0.0
|
models/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Put [model files]() here:
|
2 |
+
|
3 |
+
```
|
4 |
+
models
|
5 |
+
├── Layout
|
6 |
+
│ ├── LayoutLMv3
|
7 |
+
│ │ ├── config.json
|
8 |
+
│ │ └── model_final.pth
|
9 |
+
│ └── YOLO
|
10 |
+
│ └── yolov10l_ft.pt
|
11 |
+
├── MFD
|
12 |
+
│ └── YOLO
|
13 |
+
│ └── yolo_v8_ft.pt
|
14 |
+
├── MFR
|
15 |
+
│ ├── UniMERNet
|
16 |
+
│ │ ├── README.md
|
17 |
+
│ │ ├── config.json
|
18 |
+
│ │ ├── preprocessor_config.json
|
19 |
+
│ │ ├── pytorch_model.bin
|
20 |
+
│ │ ├── tokenizer.json
|
21 |
+
│ │ └── tokenizer_config.json
|
22 |
+
│ ├── unimernet_base
|
23 |
+
│ │ ├── README.md
|
24 |
+
│ │ ├── config.json
|
25 |
+
│ │ ├── configuration.json
|
26 |
+
│ │ ├── preprocessor_config.json
|
27 |
+
│ │ ├── pytorch_model.pth
|
28 |
+
│ │ ├── tokenizer.json
|
29 |
+
│ │ ├── tokenizer_config.json
|
30 |
+
│ │ └── unimernet_base.yaml
|
31 |
+
│ ├── unimernet_small
|
32 |
+
│ │ ├── README.md
|
33 |
+
│ │ ├── config.json
|
34 |
+
│ │ ├── configuration.json
|
35 |
+
│ │ ├── preprocessor_config.json
|
36 |
+
│ │ ├── pytorch_model.pth
|
37 |
+
│ │ ├── tokenizer.json
|
38 |
+
│ │ ├── tokenizer_config.json
|
39 |
+
│ │ └── unimernet_small.yaml
|
40 |
+
│ └── unimernet_tiny
|
41 |
+
│ ├── README.md
|
42 |
+
│ ├── config.json
|
43 |
+
│ ├── configuration.json
|
44 |
+
│ ├── preprocessor_config.json
|
45 |
+
│ ├── pytorch_model.pth
|
46 |
+
│ ├── tokenizer.json
|
47 |
+
│ ├── tokenizer_config.json
|
48 |
+
│ └── unimernet_tiny.yaml
|
49 |
+
├── README.md
|
50 |
+
└── TabRec
|
51 |
+
├── StructEqTable
|
52 |
+
│ ├── config.json
|
53 |
+
│ ├── generation_config.json
|
54 |
+
│ ├── model.safetensors
|
55 |
+
│ ├── preprocessor_config.json
|
56 |
+
│ ├── special_tokens_map.json
|
57 |
+
│ ├── spiece.model
|
58 |
+
│ ├── tokenizer.json
|
59 |
+
│ └── tokenizer_config.json
|
60 |
+
└── TableMaster
|
61 |
+
├── ch_PP-OCRv3_det_infer
|
62 |
+
│ ├── inference.pdiparams
|
63 |
+
│ ├── inference.pdiparams.info
|
64 |
+
│ └── inference.pdmodel
|
65 |
+
├── ch_PP-OCRv3_rec_infer
|
66 |
+
│ ├── inference.pdiparams
|
67 |
+
│ ├── inference.pdiparams.info
|
68 |
+
│ └── inference.pdmodel
|
69 |
+
├── ppocr_keys_v1.txt
|
70 |
+
├── table_master_structure_dict.txt
|
71 |
+
└── table_structure_tablemaster_infer
|
72 |
+
├── inference.pdiparams
|
73 |
+
├── inference.pdiparams.info
|
74 |
+
└── inference.pdmodel
|
75 |
+
```
|
models/TabRec/StructEqTable/config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/cpfs01/user/zhouhongbin/code/StructEqTable-deepspeed/ckpt/pretrained/pix2struct-base-zh",
|
3 |
+
"architectures": [
|
4 |
+
"Pix2StructForConditionalGeneration"
|
5 |
+
],
|
6 |
+
"decoder_start_token_id": 0,
|
7 |
+
"eos_token_id": 1,
|
8 |
+
"initializer_factor": 1.0,
|
9 |
+
"initializer_range": 0.02,
|
10 |
+
"is_encoder_decoder": true,
|
11 |
+
"is_vqa": false,
|
12 |
+
"model_type": "pix2struct",
|
13 |
+
"pad_token_id": 0,
|
14 |
+
"text_config": {
|
15 |
+
"dropout_rate": 0.2,
|
16 |
+
"encoder_hidden_size": 768,
|
17 |
+
"initializer_range": 0.02,
|
18 |
+
"model_type": "pix2struct_text_model",
|
19 |
+
"vocab_size": 77078
|
20 |
+
},
|
21 |
+
"tie_word_embeddings": false,
|
22 |
+
"torch_dtype": "float32",
|
23 |
+
"transformers_version": "4.37.2",
|
24 |
+
"use_cache": false,
|
25 |
+
"vision_config": {
|
26 |
+
"attention_dropout": 0.2,
|
27 |
+
"dropout_rate": 0.2,
|
28 |
+
"hidden_dropout_prob": 0.2,
|
29 |
+
"initializer_range": 0.02,
|
30 |
+
"layer_norm_bias": false,
|
31 |
+
"model_type": "pix2struct_vision_model",
|
32 |
+
"num_channels": 3,
|
33 |
+
"patch_size": 16,
|
34 |
+
"projection_dim": 768
|
35 |
+
}
|
36 |
+
}
|
models/TabRec/StructEqTable/generation_config.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"decoder_start_token_id": 0,
|
4 |
+
"eos_token_id": 1,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.37.2",
|
7 |
+
"use_cache": false
|
8 |
+
}
|
models/TabRec/StructEqTable/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:66baeb5e3b8e13f7e30cdf998c6724af7a97e8a2a3c78ece70666b6e2af278ce
|
3 |
+
size 1294046176
|
models/TabRec/StructEqTable/preprocessor_config.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_convert_rgb": true,
|
3 |
+
"do_normalize": true,
|
4 |
+
"image_processor_type": "Pix2StructImageProcessor",
|
5 |
+
"is_vqa": false,
|
6 |
+
"max_patches": 4096,
|
7 |
+
"patch_size": {
|
8 |
+
"height": 16,
|
9 |
+
"width": 16
|
10 |
+
},
|
11 |
+
"processor_class": "Pix2StructProcessor"
|
12 |
+
}
|