prepare.sh 55.8 KB
Newer Older
L
LDOUBLEV 已提交
1
#!/bin/bash
M
MissPenguin 已提交
2 3
source test_tipc/common_func.sh

L
LDOUBLEV 已提交
4
FILENAME=$1
5

L
rename  
LDOUBLEV 已提交
6 7
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer',  
#                 'whole_infer', 'klquant_whole_infer',
C
cuicheng01 已提交
8
#                 'cpp_infer', 'serving_infer']
L
LDOUBLEV 已提交
9

L
LDOUBLEV 已提交
10 11 12 13 14 15 16
MODE=$2

dataline=$(cat ${FILENAME})

# parser params
IFS=$'\n'
lines=(${dataline})
M
MissPenguin 已提交
17

L
LDOUBLEV 已提交
18
# The training params
L
LDOUBLEV 已提交
19
model_name=$(func_parser_value "${lines[1]}")
L
LDOUBLEV 已提交
20

L
LDOUBLEV 已提交
21
trainer_list=$(func_parser_value "${lines[14]}")
D
Double_V 已提交
22

L
LDOUBLEV 已提交
23
if [ ${MODE} = "benchmark_train" ];then
L
LDOUBLEV 已提交
24
    pip install -r requirements.txt
文幕地方's avatar
文幕地方 已提交
25
    if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_det" || ${model_name} =~ "det_mv3_db_v2_0" ]];then
L
LDOUBLEV 已提交
26
        wget -nc -P  ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams  --no-check-certificate
文幕地方's avatar
文幕地方 已提交
27 28 29 30 31 32
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
    fi
文幕地方's avatar
文幕地方 已提交
33
    if [[ ${model_name} =~ "ch_ppocr_server_v2_0_det" || ${model_name} =~ "ch_PP-OCRv3_det" ]];then
文幕地方's avatar
文幕地方 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
    fi
    if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]];then
        wget  -nc -P  ./pretrain_models/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_ppocr_server_v2.0_det_train.tar  && cd ../
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
L
LDOUBLEV 已提交
48
    fi
L
LDOUBLEV 已提交
49
    if [[ ${model_name} =~ "det_r50_vd_east_v2_0" ]]; then
L
LDOUBLEV 已提交
50 51
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_east_v2.0_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf det_r50_vd_east_v2.0_train.tar && cd ../
文幕地方's avatar
文幕地方 已提交
52 53 54 55 56
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
L
LDOUBLEV 已提交
57
    fi
文幕地方's avatar
文幕地方 已提交
58
    if [[ ${model_name} =~ "det_r50_db_v2_0" || ${model_name} =~ "det_r50_vd_pse_v2_0" ]];then
L
LDOUBLEV 已提交
59
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
文幕地方's avatar
文幕地方 已提交
60 61 62 63 64
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
L
LDOUBLEV 已提交
65 66 67
    fi
    if [[ ${model_name} =~ "det_r18_db_v2_0" ]];then
        wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams  --no-check-certificate
文幕地方's avatar
文幕地方 已提交
68 69 70 71 72 73
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
    fi
文幕地方's avatar
文幕地方 已提交
74 75
    if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_rec" || ${model_name} =~ "ch_ppocr_server_v2_0_rec" || ${model_name} =~ "ch_PP-OCRv2_rec" || ${model_name} =~ "rec_mv3_none_bilstm_ctc_v2_0" || ${model_name} =~ "ch_PP-OCRv3_rec" ]];then
        rm -rf ./train_data/ic15_data
文幕地方's avatar
文幕地方 已提交
76 77 78 79 80
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ic15_data_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf ic15_data_benckmark.tar
        ln -s ./ic15_data_benckmark ./ic15_data
        cd ../
    fi
文幕地方's avatar
文幕地方 已提交
81 82 83 84 85 86 87 88 89 90
    if [[ ${model_name} =~ "ch_PP-OCRv2_rec" || ${model_name} =~ "ch_PP-OCRv3_rec" ]];then
        rm -rf ./train_data/ic15_data
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ic15_data_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf ic15_data_benckmark.tar
        ln -s ./ic15_data_benckmark ./ic15_data
        cd ic15_data
        mv rec_gt_train4w.txt rec_gt_train.txt
        cd ../
        cd ../
    fi
文幕地方's avatar
文幕地方 已提交
91 92 93 94 95 96 97 98 99
    if [[ ${model_name} == "en_table_structure" ]];then
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar  && cd ../
        rm -rf ./train_data/pubtabnet
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf pubtabnet_benckmark.tar
        ln -s ./pubtabnet_benckmark ./pubtabnet
        cd ../
    fi
文幕地方's avatar
文幕地方 已提交
100
    if [[ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]]; then
文幕地方's avatar
文幕地方 已提交
101 102 103 104 105 106 107
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar && cd ../
        rm -rf ./train_data/icdar2015
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015_benckmark.tar
        ln -s ./icdar2015_benckmark ./icdar2015
        cd ../
L
LDOUBLEV 已提交
108
    fi
littletomatodonkey's avatar
littletomatodonkey 已提交
109
    if [ ${model_name} == "layoutxlm_ser" ] || [ ${model_name} == "vi_layoutxlm_ser" ]; then
110
        pip install -r ppstructure/kie/requirements.txt
文幕地方's avatar
文幕地方 已提交
111 112 113 114 115 116 117 118 119 120
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
        cd ./train_data/ && tar xf XFUND.tar
        # expand gt.txt 10 times
        cd XFUND/zh_train
        for i in `seq 10`;do cp train.json dup$i.txt;done
        cat dup* > train.json && rm -rf dup*
        cd ../../
        
        cd ../
    fi
L
LDOUBLEV 已提交
121
fi
L
LDOUBLEV 已提交
122

L
rename  
LDOUBLEV 已提交
123
if [ ${MODE} = "lite_train_lite_infer" ];then
D
Double_V 已提交
124
    # pretrain lite train data
L
LDOUBLEV 已提交
125 126
    wget -nc -P  ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams  --no-check-certificate
    wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar  --no-check-certificate
A
andyjpaddle 已提交
127
    if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]];then
L
LDOUBLEV 已提交
128
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
L
LDOUBLEV 已提交
129 130
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
131
    if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]];then
132 133 134
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
135
    if [ ${model_name} == "en_table_structure" ] || [ ${model_name} == "en_table_structure_PACT" ];then
A
andyjpaddle 已提交
136 137
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar  && cd ../
A
andyjpaddle 已提交
138 139 140
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
A
andyjpaddle 已提交
141
    fi
W
wangjingyeye 已提交
142
    if [[ ${model_name} =~ "det_r50_db_plusplus" ]];then
W
wangjingyeye 已提交
143 144
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/ResNet50_dcn_asf_synthtext_pretrained.pdparams --no-check-certificate
    fi
文幕地方's avatar
文幕地方 已提交
145 146 147 148
    if [ ${model_name} == "table_master" ];then
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/tablemaster/table_structure_tablemaster_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf table_structure_tablemaster_train.tar  && cd ../
    fi
L
LDOUBLEV 已提交
149
    cd ./pretrain_models/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
D
Double_V 已提交
150
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
151
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
152
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
153 154
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
A
andyjpaddle 已提交
155
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
L
LDOUBLEV 已提交
156 157
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
    wget -nc -P ./deploy/slim/prune https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/sen.pickle --no-check-certificate
L
LDOUBLEV 已提交
158
    
A
andyjpaddle 已提交
159
    cd ./train_data/ && tar xf icdar2015_lite.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
D
Double_V 已提交
160
    ln -s ./icdar2015_lite ./icdar2015
A
andyjpaddle 已提交
161 162
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
文幕地方's avatar
文幕地方 已提交
163 164
    mv ic15_data/rec_gt_train_lite.txt ic15_data/rec_gt_train.txt
    mv ic15_data/rec_gt_test_lite.txt ic15_data/rec_gt_test.txt
D
Double_V 已提交
165
    cd ../
T
tink2123 已提交
166
    cd ./inference && tar xf rec_inference.tar && cd ../
A
andyjpaddle 已提交
167
    if [ ${model_name} == "ch_PP-OCRv2_det" ] || [ ${model_name} == "ch_PP-OCRv2_det_PACT" ]; then
L
LDOUBLEV 已提交
168 169
        wget  -nc -P  ./pretrain_models/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_ppocr_server_v2.0_det_train.tar  && cd ../
L
LDOUBLEV 已提交
170
    fi
A
andyjpaddle 已提交
171
    if [ ${model_name} == "ch_PP-OCRv2_rec" ] || [ ${model_name} == "ch_PP-OCRv2_rec_PACT" ]; then
L
LDOUBLEV 已提交
172 173 174
        wget  -nc -P  ./pretrain_models/  https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_rec_train.tar && cd ../
    fi
A
andyjpaddle 已提交
175
    if [ ${model_name} == "ch_PP-OCRv3_rec" ] || [ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]; then
176 177 178
        wget  -nc -P  ./pretrain_models/  https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_PP-OCRv3_rec_train.tar && cd ../
    fi
L
LDOUBLEV 已提交
179
    if [ ${model_name} == "det_r18_db_v2_0" ]; then
L
LDOUBLEV 已提交
180 181
        wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams  --no-check-certificate
    fi
L
LDOUBLEV 已提交
182
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
183 184 185
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_server_pgnetA.tar && cd ../
L
LDOUBLEV 已提交
186
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
L
LDOUBLEV 已提交
187
    fi
文幕地方's avatar
文幕地方 已提交
188
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ] || [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
189
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
A
andyjpaddle 已提交
190
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_sast_icdar15_v2.0_train.tar --no-check-certificate
L
LDOUBLEV 已提交
191
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
A
andyjpaddle 已提交
192 193
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text  && cd ../
        cd ./pretrain_models && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && cd ../
L
LDOUBLEV 已提交
194
    fi
L
LDOUBLEV 已提交
195
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
L
LDOUBLEV 已提交
196 197
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar  --no-check-certificate
        cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
198
    fi
文幕地方's avatar
文幕地方 已提交
199
    if [ ${model_name} == "det_r50_db_v2_0" ]; then
200
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
201 202
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar  --no-check-certificate
        cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && cd ../
203
    fi
文幕地方's avatar
文幕地方 已提交
204
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
文幕地方's avatar
文幕地方 已提交
205 206 207
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_ppocr_mobile_v2.0_rec_train.tar && cd ../
    fi
文幕地方's avatar
文幕地方 已提交
208
    if [ ${model_name} == "det_mv3_east_v2_0" ]; then
L
LDOUBLEV 已提交
209 210 211
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_east_v2.0_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf det_mv3_east_v2.0_train.tar && cd ../
    fi
A
andyjpaddle 已提交
212 213 214 215
    if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_east_v2.0_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf det_r50_vd_east_v2.0_train.tar && cd ../
    fi
文幕地方's avatar
文幕地方 已提交
216
    if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
文幕地方's avatar
文幕地方 已提交
217 218 219
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar & cd ../
    fi
文幕地方's avatar
文幕地方 已提交
220 221 222 223
    if [ ${model_name} == "rec_r32_gaspin_bilstm_att" ]; then
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/rec_r32_gaspin_bilstm_att_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf rec_r32_gaspin_bilstm_att_train.tar && cd ../
    fi
littletomatodonkey's avatar
littletomatodonkey 已提交
224
    if [ ${model_name} == "layoutxlm_ser" ] || [ ${model_name} == "vi_layoutxlm_ser" ]; then
225
        pip install -r ppstructure/kie/requirements.txt
文幕地方's avatar
文幕地方 已提交
226 227 228 229
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
        cd ./train_data/ && tar xf XFUND.tar
        cd ../
    fi
L
LDOUBLEV 已提交
230

L
rename  
LDOUBLEV 已提交
231
elif [ ${MODE} = "whole_train_whole_infer" ];then
L
LDOUBLEV 已提交
232
    wget -nc -P  ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
D
Double_V 已提交
233
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
234
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
235
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
236 237
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar --no-check-certificate
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
A
andyjpaddle 已提交
238 239 240 241 242
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
    cd ./train_data/ && tar xf icdar2015.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar 
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
    cd ../
A
andyjpaddle 已提交
243
    if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
L
LDOUBLEV 已提交
244
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
L
LDOUBLEV 已提交
245 246
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
247
    if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
248 249 250
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
    fi
L
LDOUBLEV 已提交
251
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
252
        wget -nc -P ./train_data/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar  --no-check-certificate
L
LDOUBLEV 已提交
253 254
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_server_pgnetA.tar && cd ../
L
LDOUBLEV 已提交
255
        cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text  && cd ../
L
LDOUBLEV 已提交
256
    fi
文幕地方's avatar
文幕地方 已提交
257
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
258
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
259 260
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar  --no-check-certificate
        cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text  && cd ../
L
LDOUBLEV 已提交
261
    fi
A
andyjpaddle 已提交
262
    if [[ ${model_name} =~ "en_table_structure" ]];then
A
andyjpaddle 已提交
263 264
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar  && cd ../
A
andyjpaddle 已提交
265 266 267
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
A
andyjpaddle 已提交
268
    fi
L
rename  
LDOUBLEV 已提交
269
elif [ ${MODE} = "lite_train_whole_infer" ];then
L
LDOUBLEV 已提交
270
    wget -nc -P  ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
D
Double_V 已提交
271
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
272
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
273
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
274 275
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_infer.tar --no-check-certificate
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
A
andyjpaddle 已提交
276 277
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
    cd ./train_data/ && tar xf icdar2015_infer.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
D
Double_V 已提交
278
    ln -s ./icdar2015_infer ./icdar2015
A
andyjpaddle 已提交
279 280
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
    wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
D
Double_V 已提交
281
    cd ../
A
andyjpaddle 已提交
282
    if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
L
LDOUBLEV 已提交
283
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
L
LDOUBLEV 已提交
284 285
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
286
    if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
287 288 289
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
290
    if [[ ${model_name} =~ "en_table_structure" ]];then
A
andyjpaddle 已提交
291 292
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar  && cd ../
A
andyjpaddle 已提交
293 294 295
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
A
andyjpaddle 已提交
296
    fi
L
rename  
LDOUBLEV 已提交
297
elif [ ${MODE} = "whole_infer" ];then
L
LDOUBLEV 已提交
298
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
A
andyjpaddle 已提交
299
    wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
L
LDOUBLEV 已提交
300
    cd ./inference && tar xf rec_inference.tar  && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
301
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
L
LDOUBLEV 已提交
302
        eval_model_name="ch_ppocr_mobile_v2.0_det_train"
T
tink2123 已提交
303
        rm -rf ./train_data/icdar2015
L
LDOUBLEV 已提交
304
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar --no-check-certificate
L
LDOUBLEV 已提交
305 306
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
307
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
A
andyjpaddle 已提交
308 309 310
        eval_model_name="ch_ppocr_mobile_v2.0_det_prune_infer"
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/slim/ch_ppocr_mobile_v2.0_det_prune_infer.tar --no-check-certificate
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
311
    elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
L
LDOUBLEV 已提交
312
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate
L
LDOUBLEV 已提交
313
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_train.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
314
    elif  [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
L
LDOUBLEV 已提交
315 316
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
L
LDOUBLEV 已提交
317
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
318
    elif  [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
L
LDOUBLEV 已提交
319 320
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
T
tink2123 已提交
321
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
322
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
A
andyjpaddle 已提交
323 324
        eval_model_name="ch_ppocr_mobile_v2.0_rec_slim_infer"
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_slim_infer.tar --no-check-certificate
A
andyjpaddle 已提交
325
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
文幕地方's avatar
文幕地方 已提交
326
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
A
andyjpaddle 已提交
327 328
        eval_model_name="ch_PP-OCRv2_rec_infer"
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
A
andyjpaddle 已提交
329
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
D
Double_V 已提交
330
    fi 
331 332 333 334 335 336 337 338 339 340
    if [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
    fi
    if [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
    fi
A
andyjpaddle 已提交
341
    if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]]; then
L
LDOUBLEV 已提交
342
        eval_model_name="ch_PP-OCRv2_det_infer"
L
LDOUBLEV 已提交
343
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
L
LDOUBLEV 已提交
344
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
345
    fi
A
andyjpaddle 已提交
346
    if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]]; then
347 348 349 350
        eval_model_name="ch_PP-OCRv3_det_infer"
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
    fi
A
andyjpaddle 已提交
351
    if [[ ${model_name} =~ "ch_PP-OCRv2_rec" ]]; then
A
andyjpaddle 已提交
352 353
        eval_model_name="ch_PP-OCRv2_rec_infer"
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
A
andyjpaddle 已提交
354 355
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_slim_quant_infer.tar --no-check-certificate
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_PP-OCRv2_rec_slim_quant_infer.tar && cd ../
A
andyjpaddle 已提交
356
    fi   
A
andyjpaddle 已提交
357
    if [[ ${model_name} =~ "ch_PP-OCRv3_rec" ]]; then
358 359
        eval_model_name="ch_PP-OCRv3_rec_infer"
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
A
andyjpaddle 已提交
360 361 362
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_slim_infer.tar --no-check-certificate
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_PP-OCRv3_rec_slim_infer.tar && cd ../
    fi
A
andyjpaddle 已提交
363
    if [[ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]]; then
A
andyjpaddle 已提交
364 365
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_slim_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_rec_slim_infer.tar && cd ../
366
    fi  
L
LDOUBLEV 已提交
367
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
368
        wget -nc -P ./inference/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar  --no-check-certificate
A
andyjpaddle 已提交
369
        cd ./inference && tar xf en_server_pgnetA.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
370
    fi
文幕地方's avatar
文幕地方 已提交
371
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ]; then
L
LDOUBLEV 已提交
372
        wget -nc -P  ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_sast_icdar15_v2.0_train.tar --no-check-certificate
A
andyjpaddle 已提交
373
        cd ./inference/ && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
374
    fi
文幕地方's avatar
文幕地方 已提交
375
    if [ ${model_name} == "rec_mv3_none_none_ctc_v2_0" ]; then
T
tink2123 已提交
376
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mv3_none_none_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
377
        cd ./inference/ && tar xf rec_mv3_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
378
    fi
文幕地方's avatar
文幕地方 已提交
379
    if [ ${model_name} == "rec_r34_vd_none_none_ctc_v2_0" ]; then
T
tink2123 已提交
380
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r34_vd_none_none_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
381
        cd ./inference/ && tar xf rec_r34_vd_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
382
    fi
文幕地方's avatar
文幕地方 已提交
383
    if [ ${model_name} == "rec_mv3_none_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
384
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mv3_none_bilstm_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
385
        cd ./inference/ && tar xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
386
    fi
文幕地方's avatar
文幕地方 已提交
387
    if [ ${model_name} == "rec_r34_vd_none_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
388
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r34_vd_none_bilstm_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
389
        cd ./inference/ && tar xf rec_r34_vd_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
390
    fi
文幕地方's avatar
文幕地方 已提交
391
    if [ ${model_name} == "rec_mv3_tps_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
392
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mv3_tps_bilstm_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
393
        cd ./inference/ && tar xf rec_mv3_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
394
    fi
文幕地方's avatar
文幕地方 已提交
395
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
396
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar --no-check-certificate
T
tink2123 已提交
397
        cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
398
    fi
文幕地方's avatar
文幕地方 已提交
399
    if [ ${model_name} == "ch_ppocr_server_v2_0_rec" ]; then
L
LDOUBLEV 已提交
400
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_train.tar --no-check-certificate
T
tink2123 已提交
401
        cd ./inference/ && tar xf ch_ppocr_server_v2.0_rec_train.tar && cd ../
T
tink2123 已提交
402
    fi
文幕地方's avatar
文幕地方 已提交
403
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec" ]; then
A
andyjpaddle 已提交
404 405 406 407 408 409 410
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_train.tar --no-check-certificate
        cd ./inference/ && tar xf ch_ppocr_mobile_v2.0_rec_train.tar && cd ../
    fi
    if [ ${model_name} == "rec_mtb_nrtr" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mtb_nrtr_train.tar --no-check-certificate
        cd ./inference/ && tar xf rec_mtb_nrtr_train.tar && cd ../
    fi
文幕地方's avatar
文幕地方 已提交
411
    if [ ${model_name} == "rec_mv3_tps_bilstm_att_v2_0" ]; then
A
andyjpaddle 已提交
412 413 414
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mv3_tps_bilstm_att_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf rec_mv3_tps_bilstm_att_v2.0_train.tar && cd ../
    fi
文幕地方's avatar
文幕地方 已提交
415
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_att_v2_0" ]; then
A
andyjpaddle 已提交
416 417 418 419 420 421 422 423 424 425 426
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r34_vd_tps_bilstm_att_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_att_v2.0_train.tar && cd ../
    fi
    if [ ${model_name} == "rec_r31_sar" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/rec/rec_r31_sar_train.tar --no-check-certificate
        cd ./inference/ && tar xf rec_r31_sar_train.tar && cd ../
    fi
    if [ ${model_name} == "rec_r50_fpn_vd_none_srn" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r50_vd_srn_train.tar --no-check-certificate
        cd ./inference/ && tar xf rec_r50_vd_srn_train.tar && cd ../
    fi
T
tink2123 已提交
427
    
文幕地方's avatar
文幕地方 已提交
428
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
429 430 431
        wget -nc -P  ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_sast_totaltext_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf det_r50_vd_sast_totaltext_v2.0_train.tar && cd ../
    fi
L
LDOUBLEV 已提交
432
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
433
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar  --no-check-certificate
A
andyjpaddle 已提交
434
        cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
435
    fi
文幕地方's avatar
文幕地方 已提交
436
    if [ ${model_name} == "det_r50_db_v2_0" ]; then
437
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar  --no-check-certificate
A
andyjpaddle 已提交
438
        cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
439
    fi
文幕地方's avatar
文幕地方 已提交
440
    if [ ${model_name} == "det_mv3_pse_v2_0" ]; then
L
LDOUBLEV 已提交
441 442 443
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/det_mv3_pse_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf det_mv3_pse_v2.0_train.tar & cd ../
    fi
L
LDOUBLEV 已提交
444
    if [ ${model_name} == "det_r50_vd_pse_v2_0" ]; then
L
LDOUBLEV 已提交
445 446 447
        wget -nc -P ./inference/  https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/det_r50_vd_pse_v2.0_train.tar  --no-check-certificate
        cd ./inference/ && tar xf det_r50_vd_pse_v2.0_train.tar & cd ../
    fi
文幕地方's avatar
文幕地方 已提交
448
    if [ ${model_name} == "det_mv3_east_v2_0" ]; then
L
LDOUBLEV 已提交
449 450 451
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_east_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf det_mv3_east_v2.0_train.tar & cd ../
    fi
L
LDOUBLEV 已提交
452
    if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
L
LDOUBLEV 已提交
453 454
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_east_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf det_r50_vd_east_v2.0_train.tar & cd ../
L
LDOUBLEV 已提交
455
    fi
文幕地方's avatar
文幕地方 已提交
456
    if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
文幕地方's avatar
文幕地方 已提交
457 458 459
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
        cd ./inference/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar & cd ../
    fi
A
andyjpaddle 已提交
460
    if [[ ${model_name} =~ "en_table_structure" ]];then
A
andyjpaddle 已提交
461
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
A
andyjpaddle 已提交
462 463 464
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
A
andyjpaddle 已提交
465
    fi
L
LDOUBLEV 已提交
466
fi
L
LDOUBLEV 已提交
467

A
andyjpaddle 已提交
468
if [[ ${model_name} =~ "KL" ]]; then
L
LDOUBLEV 已提交
469
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
L
LDOUBLEV 已提交
470
    cd ./train_data/ && tar xf icdar2015_lite.tar && rm -rf ./icdar2015 && ln -s ./icdar2015_lite ./icdar2015 && cd ../
文幕地方's avatar
文幕地方 已提交
471
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
L
LDOUBLEV 已提交
472 473 474
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../ 
L
LDOUBLEV 已提交
475
    fi
A
andyjpaddle 已提交
476
    if [ ${model_name} = "ch_PP-OCRv2_rec_KL" ]; then
L
reset  
LDOUBLEV 已提交
477 478
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar  --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
479 480
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
        cd ./train_data/ && tar xf ic15_data.tar && cd ../
L
reset  
LDOUBLEV 已提交
481 482
        cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
    fi
A
andyjpaddle 已提交
483
    if [ ${model_name} = "ch_PP-OCRv3_rec_KL" ]; then
484 485 486
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar  --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
A
andyjpaddle 已提交
487 488 489 490
        cd ./train_data/ && tar xf ic15_data.tar 
        wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
        wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
        cd ../
491 492
        cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
    fi
A
andyjpaddle 已提交
493
    if [ ${model_name} = "ch_PP-OCRv2_det_KL" ]; then
L
LDOUBLEV 已提交
494
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
L
reset  
LDOUBLEV 已提交
495 496
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
497
    fi 
A
andyjpaddle 已提交
498
    if [ ${model_name} = "ch_PP-OCRv3_det_KL" ]; then
499 500 501 502
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
    fi 
文幕地方's avatar
文幕地方 已提交
503
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
文幕地方's avatar
文幕地方 已提交
504 505 506 507 508
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
        cd ./train_data/ && tar xf ic15_data.tar && cd ../
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar &&  cd ../ 
A
andyjpaddle 已提交
509 510 511 512 513 514 515 516 517
    fi
    if [ ${model_name} = "en_table_structure_KL" ];then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
        cd ./train_data/ && tar xf pubtabnet.tar && cd ../
    fi
L
fix bug  
LDOUBLEV 已提交
518 519 520
fi

if [ ${MODE} = "cpp_infer" ];then
文幕地方's avatar
文幕地方 已提交
521
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
L
LDOUBLEV 已提交
522 523
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar  --no-check-certificate
M
MissPenguin 已提交
524
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
525
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
A
andyjpaddle 已提交
526 527 528
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
529
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
A
andyjpaddle 已提交
530 531 532
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
533
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec" ]; then
A
andyjpaddle 已提交
534 535 536
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
文幕地方's avatar
文幕地方 已提交
537
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
A
andyjpaddle 已提交
538 539 540
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
文幕地方's avatar
文幕地方 已提交
541
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
A
andyjpaddle 已提交
542 543 544
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
文幕地方's avatar
文幕地方 已提交
545
    elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
A
andyjpaddle 已提交
546 547 548
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
549
    elif [ ${model_name} = "ch_ppocr_server_v2_0_rec" ]; then
A
andyjpaddle 已提交
550 551 552 553 554 555 556
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_server_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
    elif [ ${model_name} = "ch_PP-OCRv2_det" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
557 558 559 560 561 562 563 564
    elif [ ${model_name} = "ch_PP-OCRv2_det_KL" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
    elif [ ${model_name} = "ch_PP-OCRv2_det_PACT" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
565 566 567 568
    elif [ ${model_name} = "ch_PP-OCRv2_rec" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_rec_infer.tar && tar xf rec_inference.tar && cd ../
A
andyjpaddle 已提交
569 570 571 572 573 574 575 576
    elif [ ${model_name} = "ch_PP-OCRv2_rec_KL" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
    elif [ ${model_name} = "ch_PP-OCRv2_rec_PACT" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
A
andyjpaddle 已提交
577
    elif [ ${model_name} = "ch_PP-OCRv3_det" ]; then
578 579 580
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
581 582 583 584 585 586 587 588
    elif [ ${model_name} = "ch_PP-OCRv3_det_KL" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
    elif [ ${model_name} = "ch_PP-OCRv3_det_PACT" ]; then
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
589
    elif [ ${model_name} = "ch_PP-OCRv3_rec" ]; then
590 591 592
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_rec_infer.tar && tar xf rec_inference.tar && cd ../
A
andyjpaddle 已提交
593 594 595 596 597 598 599 600
    elif [ ${model_name} = "ch_PP-OCRv3_rec_KL" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_klquant_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
    elif [ ${model_name} = "ch_PP-OCRv3_rec_PACT" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_pact_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
文幕地方's avatar
文幕地方 已提交
601
    elif  [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
L
LDOUBLEV 已提交
602 603 604
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar  --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar  --no-check-certificate
M
MissPenguin 已提交
605
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
606
    elif  [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
A
andyjpaddle 已提交
607 608 609 610 611 612 613 614 615 616
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar  --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
    elif  [ ${model_name} = "ch_PP-OCRv2" ]; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar  --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
    elif  [ ${model_name} = "ch_PP-OCRv3" ]; then
617 618 619 620
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar  --no-check-certificate
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar  --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../
M
MissPenguin 已提交
621
    fi 
D
Double_V 已提交
622
fi
T
tink2123 已提交
623

T
tink2123 已提交
624 625
if [ ${MODE} = "serving_infer" ];then
    # prepare serving env
T
tink2123 已提交
626 627 628 629
    python_name_list=$(func_parser_value "${lines[2]}")
    IFS='|'
    array=(${python_name_list})
    python_name=${array[0]}
A
andyjpaddle 已提交
630 631 632
    ${python_name} -m pip install paddle-serving-server-gpu
    ${python_name} -m pip install paddle_serving_client
    ${python_name} -m pip install paddle-serving-app
A
andyjpaddle 已提交
633
    # wget model
文幕地方's avatar
文幕地方 已提交
634
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_det_KL" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_KL" ] ; then
A
andyjpaddle 已提交
635 636 637 638 639 640 641 642 643 644 645
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_klquant_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_klquant_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_klquant_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_klquant_infer.tar && cd ../
    elif [ ${model_name} == "ch_PP-OCRv2_det_KL" ] || [ ${model_name} == "ch_PP-OCRv2_rec_KL" ] ; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_klquant_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_klquant_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_klquant_infer.tar && tar xf ch_PP-OCRv2_rec_klquant_infer.tar && cd ../
    elif [ ${model_name} == "ch_PP-OCRv3_det_KL" ] || [ ${model_name} == "ch_PP-OCRv3_rec_KL" ] ; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_klquant_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_klquant_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_klquant_infer.tar && tar xf ch_PP-OCRv3_rec_klquant_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
646
    elif [ ${model_name} == "ch_ppocr_mobile_v2_0_det_PACT" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_PACT" ] ; then
A
andyjpaddle 已提交
647 648 649 650 651 652 653 654 655 656 657
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_pact_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_pact_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_pact_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_pact_infer.tar && cd ../
    elif [ ${model_name} == "ch_PP-OCRv2_det_PACT" ] || [ ${model_name} == "ch_PP-OCRv2_rec_PACT" ] ; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_pact_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_pact_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_pact_infer.tar && tar xf ch_PP-OCRv2_rec_pact_infer.tar && cd ../
    elif [ ${model_name} == "ch_PP-OCRv3_det_PACT" ] || [ ${model_name} == "ch_PP-OCRv3_rec_PACT" ] ; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_pact_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_pact_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_pact_infer.tar && tar xf ch_PP-OCRv3_rec_pact_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
658
    elif [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
A
andyjpaddle 已提交
659 660 661
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
662
    elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
A
andyjpaddle 已提交
663 664 665 666 667 668 669 670 671 672 673 674 675
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && cd ../
    elif [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
    elif [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
    fi
    # wget data
A
andyjpaddle 已提交
676
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
677
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
A
andyjpaddle 已提交
678
    cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
T
tink2123 已提交
679
fi
C
cuicheng01 已提交
680

T
tink2123 已提交
681 682 683
if [ ${MODE} = "paddle2onnx_infer" ];then
    # prepare serving env
    python_name=$(func_parser_value "${lines[2]}")
684
    ${python_name} -m pip install paddle2onnx
A
andyjpaddle 已提交
685
    ${python_name} -m pip install onnxruntime
T
tink2123 已提交
686
    # wget model
文幕地方's avatar
文幕地方 已提交
687
    if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
A
andyjpaddle 已提交
688 689 690
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
691
    elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
A
andyjpaddle 已提交
692 693 694 695 696 697 698 699 700 701 702 703 704
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && cd ../
    elif [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
    elif [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
        cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
    fi
    
T
tink2123 已提交
705 706 707
    # wget data
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
    wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar
A
andyjpaddle 已提交
708
    cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
T
tink2123 已提交
709 710
    
fi