prepare.sh 64.6 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
文幕地方's avatar
文幕地方 已提交
24 25 26 27
    python_name_list=$(func_parser_value "${lines[2]}")
    array=(${python_name_list}) 
    python_name=${array[0]}
    ${python_name} -m pip install -r requirements.txt
文幕地方's avatar
文幕地方 已提交
28
    if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_det" || ${model_name} =~ "det_mv3_db_v2_0" ]];then
L
LDOUBLEV 已提交
29
        wget -nc -P  ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams  --no-check-certificate
文幕地方's avatar
文幕地方 已提交
30 31 32 33 34
        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 ../
35 36 37 38 39 40 41
        if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_det" ]];then
            # expand gt.txt 2 times
            cd ./train_data/icdar2015/text_localization
            for i in `seq 2`;do cp train_icdar2015_label.txt dup$i.txt;done
            cat dup* > train_icdar2015_label.txt && rm -rf dup*
            cd ../../../
        fi
文幕地方's avatar
文幕地方 已提交
42
    fi
文幕地方's avatar
文幕地方 已提交
43
    if [[ ${model_name} =~ "ch_ppocr_server_v2_0_det" || ${model_name} =~ "ch_PP-OCRv3_det" ]];then
文幕地方's avatar
文幕地方 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57
        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 已提交
58
    fi
L
LDOUBLEV 已提交
59
    if [[ ${model_name} =~ "det_r50_vd_east_v2_0" ]]; then
L
LDOUBLEV 已提交
60 61
        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
文幕地方 已提交
62 63 64 65 66
        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 已提交
67
    fi
文幕地方's avatar
文幕地方 已提交
68
    if [[ ${model_name} =~ "det_r50_db_v2_0" || ${model_name} =~ "det_r50_vd_pse_v2_0" ]];then
L
LDOUBLEV 已提交
69
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
文幕地方's avatar
文幕地方 已提交
70 71 72 73 74
        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 已提交
75 76 77
    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
文幕地方 已提交
78 79 80 81 82 83
        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
文幕地方 已提交
84 85
    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
文幕地方 已提交
86 87 88 89 90
        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
文幕地方 已提交
91 92 93 94 95 96 97 98 99 100
    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
文幕地方 已提交
101 102 103 104 105 106 107 108 109
    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
文幕地方 已提交
110
    if [[ ${model_name} == "slanet" ]];then
111 112
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppstructure_mobile_v2.0_SLANet_train.tar  && cd ../
文幕地方's avatar
文幕地方 已提交
113 114 115 116 117 118
        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
文幕地方 已提交
119
    if [[ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]]; then
文幕地方's avatar
文幕地方 已提交
120 121 122 123 124 125 126
        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 已提交
127
    fi
littletomatodonkey's avatar
littletomatodonkey 已提交
128
    if [ ${model_name} == "layoutxlm_ser" ] || [ ${model_name} == "vi_layoutxlm_ser" ]; then
文幕地方's avatar
文幕地方 已提交
129 130
        ${python_name} -m pip install -r ppstructure/kie/requirements.txt
        ${python_name} -m pip install opencv-python -U
文幕地方's avatar
文幕地方 已提交
131 132 133 134 135 136 137 138 139 140
        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 已提交
141
fi
L
LDOUBLEV 已提交
142

L
rename  
LDOUBLEV 已提交
143
if [ ${MODE} = "lite_train_lite_infer" ];then
文幕地方's avatar
文幕地方 已提交
144 145 146 147
    python_name_list=$(func_parser_value "${lines[2]}")
    array=(${python_name_list}) 
    python_name=${array[0]}
    ${python_name} -m pip install -r requirements.txt
文幕地方's avatar
文幕地方 已提交
148
    ${python_name} -m pip install https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl
D
Double_V 已提交
149
    # pretrain lite train data
L
LDOUBLEV 已提交
150 151
    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 已提交
152
    if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]];then
L
LDOUBLEV 已提交
153
        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 已提交
154 155
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
156
    if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]];then
157 158 159
        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 已提交
160
    if [ ${model_name} == "en_table_structure" ] || [ ${model_name} == "en_table_structure_PACT" ];then
A
andyjpaddle 已提交
161 162
        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 已提交
163 164 165
        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 ../
文幕地方's avatar
文幕地方 已提交
166
    fi
167
    if [[ ${model_name} =~ "slanet" ]];then
文幕地方's avatar
文幕地方 已提交
168 169 170 171 172
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf en_ppstructure_mobile_v2.0_SLANet_train.tar  && cd ../
        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 已提交
173
    fi
W
wangjingyeye 已提交
174
    if [[ ${model_name} =~ "det_r50_db_plusplus" ]];then
W
wangjingyeye 已提交
175 176
        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
文幕地方 已提交
177 178 179 180
    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 已提交
181
    cd ./pretrain_models/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
D
Double_V 已提交
182
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
183
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
184
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
185 186
    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 已提交
187
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
L
LDOUBLEV 已提交
188 189
    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 已提交
190
    
A
andyjpaddle 已提交
191
    cd ./train_data/ && tar xf icdar2015_lite.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
D
Double_V 已提交
192
    ln -s ./icdar2015_lite ./icdar2015
A
andyjpaddle 已提交
193 194
    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
文幕地方 已提交
195 196
    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 已提交
197
    cd ../
T
tink2123 已提交
198
    cd ./inference && tar xf rec_inference.tar && cd ../
A
andyjpaddle 已提交
199
    if [ ${model_name} == "ch_PP-OCRv2_det" ] || [ ${model_name} == "ch_PP-OCRv2_det_PACT" ]; then
L
LDOUBLEV 已提交
200 201
        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 已提交
202
    fi
A
andyjpaddle 已提交
203
    if [ ${model_name} == "ch_PP-OCRv2_rec" ] || [ ${model_name} == "ch_PP-OCRv2_rec_PACT" ]; then
L
LDOUBLEV 已提交
204 205 206
        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 已提交
207
    if [ ${model_name} == "ch_PP-OCRv3_rec" ] || [ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]; then
208 209 210
        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 已提交
211
    if [ ${model_name} == "det_r18_db_v2_0" ]; then
L
LDOUBLEV 已提交
212 213
        wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams  --no-check-certificate
    fi
L
LDOUBLEV 已提交
214
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
215 216 217
        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 已提交
218
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
L
LDOUBLEV 已提交
219
    fi
文幕地方's avatar
文幕地方 已提交
220
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ] || [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
221
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
A
andyjpaddle 已提交
222
        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 已提交
223
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
A
andyjpaddle 已提交
224 225
        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 已提交
226
    fi
L
LDOUBLEV 已提交
227
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
L
LDOUBLEV 已提交
228 229
        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 ../
230
    fi
文幕地方's avatar
文幕地方 已提交
231
    if [ ${model_name} == "det_r50_db_v2_0" ]; then
232
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
233 234
        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 ../
235
    fi
文幕地方's avatar
文幕地方 已提交
236
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
文幕地方's avatar
文幕地方 已提交
237 238
        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 ../
239
        ${python_name} -m pip install paddleslim
240 241 242
    fi
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_det_FPGM" ]; then
        ${python_name} -m pip install paddleslim
文幕地方's avatar
文幕地方 已提交
243
    fi
文幕地方's avatar
文幕地方 已提交
244
    if [ ${model_name} == "det_mv3_east_v2_0" ]; then
L
LDOUBLEV 已提交
245 246 247
        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 已提交
248 249 250 251
    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
文幕地方 已提交
252
    if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
文幕地方's avatar
文幕地方 已提交
253 254 255
        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
文幕地方 已提交
256 257 258 259
    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
文幕地方's avatar
文幕地方 已提交
260 261 262 263 264 265 266 267 268 269
    if [ ${model_name} == "layoutxlm_ser" ]; then
        ${python_name} -m pip install -r ppstructure/kie/requirements.txt
        ${python_name} -m pip install opencv-python -U
        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 ../

        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh.tar --no-check-certificate
        cd ./pretrain_models/ && tar xf ser_LayoutXLM_xfun_zh.tar  && cd ../
    fi
270
    if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
文幕地方's avatar
文幕地方 已提交
271 272
        ${python_name} -m pip install -r ppstructure/kie/requirements.txt
        ${python_name} -m pip install opencv-python -U
文幕地方's avatar
文幕地方 已提交
273 274 275
        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 ../
276 277 278 279
        if [ ${model_name} == "vi_layoutxlm_ser_PACT" ]; then
            wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_pretrained.tar --no-check-certificate
            cd ./pretrain_models/ && tar xf ser_vi_layoutxlm_xfund_pretrained.tar  && cd ../
        fi
文幕地方's avatar
文幕地方 已提交
280
    fi
H
huangjun12 已提交
281 282 283 284 285
    if [ ${model_name} == "det_r18_ct" ]; then
        wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams  --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ct_tipc/total_text_lite2.tar --no-check-certificate
        cd ./train_data && tar xf total_text_lite2.tar && ln -s total_text_lite2 total_text && cd ../
    fi
L
LDOUBLEV 已提交
286

L
rename  
LDOUBLEV 已提交
287
elif [ ${MODE} = "whole_train_whole_infer" ];then
L
LDOUBLEV 已提交
288
    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 已提交
289
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
290
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
291
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
292 293
    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 已提交
294 295 296 297 298
    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 已提交
299
    if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
L
LDOUBLEV 已提交
300
        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 已提交
301 302
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
303
    if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
304 305 306
        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 已提交
307
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
308
        wget -nc -P ./train_data/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar  --no-check-certificate
L
LDOUBLEV 已提交
309 310
        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 已提交
311
        cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text  && cd ../
L
LDOUBLEV 已提交
312
    fi
文幕地方's avatar
文幕地方 已提交
313
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
314
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
315 316
        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 已提交
317
    fi
A
andyjpaddle 已提交
318
    if [[ ${model_name} =~ "en_table_structure" ]];then
A
andyjpaddle 已提交
319 320
        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 已提交
321 322 323
        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 已提交
324
    fi
L
rename  
LDOUBLEV 已提交
325
elif [ ${MODE} = "lite_train_whole_infer" ];then
L
LDOUBLEV 已提交
326
    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 已提交
327
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
328
    rm -rf ./train_data/ic15_data
A
andyjpaddle 已提交
329
    rm -rf ./train_data/pubtabnet
L
LDOUBLEV 已提交
330 331
    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 已提交
332 333
    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 已提交
334
    ln -s ./icdar2015_infer ./icdar2015
A
andyjpaddle 已提交
335 336
    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 已提交
337
    cd ../
A
andyjpaddle 已提交
338
    if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
L
LDOUBLEV 已提交
339
        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 已提交
340 341
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
A
andyjpaddle 已提交
342
    if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
343 344 345
        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 已提交
346
    if [[ ${model_name} =~ "en_table_structure" ]];then
A
andyjpaddle 已提交
347 348
        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 已提交
349 350 351
        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 已提交
352
    fi
L
rename  
LDOUBLEV 已提交
353
elif [ ${MODE} = "whole_infer" ];then
文幕地方's avatar
文幕地方 已提交
354 355 356
    python_name_list=$(func_parser_value "${lines[2]}")
    array=(${python_name_list}) 
    python_name=${array[0]}
文幕地方's avatar
文幕地方 已提交
357 358
    ${python_name} -m pip install paddleslim --force-reinstall
    ${python_name} -m pip install -r requirements.txt
L
LDOUBLEV 已提交
359
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
A
andyjpaddle 已提交
360
    wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
L
LDOUBLEV 已提交
361
    cd ./inference && tar xf rec_inference.tar  && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
362
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
文幕地方's avatar
文幕地方 已提交
363 364
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
    cd ./train_data/ && tar xf XFUND.tar && tar xf pubtabnet.tar && cd ../
文幕地方's avatar
文幕地方 已提交
365 366
    head -n 2 train_data/XFUND/zh_val/val.json > train_data/XFUND/zh_val/val_lite.json
    mv train_data/XFUND/zh_val/val_lite.json train_data/XFUND/zh_val/val.json
文幕地方's avatar
文幕地方 已提交
367
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
L
LDOUBLEV 已提交
368
        eval_model_name="ch_ppocr_mobile_v2.0_det_train"
T
tink2123 已提交
369
        rm -rf ./train_data/icdar2015
L
LDOUBLEV 已提交
370
        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 已提交
371 372
        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
文幕地方 已提交
373
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
A
andyjpaddle 已提交
374 375 376
        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
文幕地方 已提交
377
    elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
L
LDOUBLEV 已提交
378
        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 已提交
379
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_train.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
380
    elif  [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
L
LDOUBLEV 已提交
381 382
        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 已提交
383
        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
文幕地方 已提交
384
    elif  [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
L
LDOUBLEV 已提交
385 386
        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 已提交
387
        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
文幕地方 已提交
388
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
A
andyjpaddle 已提交
389 390
        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 已提交
391
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
文幕地方's avatar
文幕地方 已提交
392
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
A
andyjpaddle 已提交
393 394
        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 已提交
395
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
D
Double_V 已提交
396
    fi 
397 398 399 400 401 402 403 404 405 406
    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 已提交
407
    if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]]; then
L
LDOUBLEV 已提交
408
        eval_model_name="ch_PP-OCRv2_det_infer"
L
LDOUBLEV 已提交
409
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
L
LDOUBLEV 已提交
410
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
411
    fi
A
andyjpaddle 已提交
412
    if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]]; then
413 414 415 416
        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 已提交
417
    if [[ ${model_name} =~ "ch_PP-OCRv2_rec" ]]; then
A
andyjpaddle 已提交
418 419
        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 已提交
420 421
        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 已提交
422
    fi   
A
andyjpaddle 已提交
423
    if [[ ${model_name} =~ "ch_PP-OCRv3_rec" ]]; then
424 425
        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 已提交
426 427 428
        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 已提交
429
    if [[ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]]; then
A
andyjpaddle 已提交
430 431
        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 ../
432
    fi  
L
LDOUBLEV 已提交
433
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
434
        wget -nc -P ./inference/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar  --no-check-certificate
A
andyjpaddle 已提交
435
        cd ./inference && tar xf en_server_pgnetA.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
436
    fi
文幕地方's avatar
文幕地方 已提交
437
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ]; then
L
LDOUBLEV 已提交
438
        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 已提交
439
        cd ./inference/ && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
440
    fi
文幕地方's avatar
文幕地方 已提交
441
    if [ ${model_name} == "rec_mv3_none_none_ctc_v2_0" ]; then
T
tink2123 已提交
442
        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 已提交
443
        cd ./inference/ && tar xf rec_mv3_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
444
    fi
文幕地方's avatar
文幕地方 已提交
445
    if [ ${model_name} == "rec_r34_vd_none_none_ctc_v2_0" ]; then
T
tink2123 已提交
446
        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 已提交
447
        cd ./inference/ && tar xf rec_r34_vd_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
448
    fi
文幕地方's avatar
文幕地方 已提交
449
    if [ ${model_name} == "rec_mv3_none_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
450
        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 已提交
451
        cd ./inference/ && tar xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
452
    fi
文幕地方's avatar
文幕地方 已提交
453
    if [ ${model_name} == "rec_r34_vd_none_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
454
        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 已提交
455
        cd ./inference/ && tar xf rec_r34_vd_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
456
    fi
文幕地方's avatar
文幕地方 已提交
457
    if [ ${model_name} == "rec_mv3_tps_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
458
        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 已提交
459
        cd ./inference/ && tar xf rec_mv3_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
460
    fi
文幕地方's avatar
文幕地方 已提交
461
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_ctc_v2_0" ]; then
T
tink2123 已提交
462
        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 已提交
463
        cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
464
    fi
文幕地方's avatar
文幕地方 已提交
465
    if [ ${model_name} == "ch_ppocr_server_v2_0_rec" ]; then
L
LDOUBLEV 已提交
466
        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 已提交
467
        cd ./inference/ && tar xf ch_ppocr_server_v2.0_rec_train.tar && cd ../
T
tink2123 已提交
468
    fi
文幕地方's avatar
文幕地方 已提交
469
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec" ]; then
A
andyjpaddle 已提交
470 471 472 473 474 475 476
        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
文幕地方 已提交
477
    if [ ${model_name} == "rec_mv3_tps_bilstm_att_v2_0" ]; then
A
andyjpaddle 已提交
478 479 480
        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
文幕地方 已提交
481
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_att_v2_0" ]; then
A
andyjpaddle 已提交
482 483 484 485 486 487 488 489 490 491 492
        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 已提交
493
    
文幕地方's avatar
文幕地方 已提交
494
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
L
LDOUBLEV 已提交
495 496 497
        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 已提交
498
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
499
        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 已提交
500
        cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
501
    fi
文幕地方's avatar
文幕地方 已提交
502
    if [ ${model_name} == "det_r50_db_v2_0" ]; then
503
        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 已提交
504
        cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
505
    fi
文幕地方's avatar
文幕地方 已提交
506
    if [ ${model_name} == "det_mv3_pse_v2_0" ]; then
L
LDOUBLEV 已提交
507 508 509
        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 已提交
510
    if [ ${model_name} == "det_r50_vd_pse_v2_0" ]; then
L
LDOUBLEV 已提交
511 512 513
        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
文幕地方 已提交
514
    if [ ${model_name} == "det_mv3_east_v2_0" ]; then
L
LDOUBLEV 已提交
515 516 517
        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 已提交
518
    if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
L
LDOUBLEV 已提交
519 520
        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 已提交
521
    fi
文幕地方's avatar
文幕地方 已提交
522
    if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
文幕地方's avatar
文幕地方 已提交
523 524 525
        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 已提交
526 527 528
    if [[ ${model_name} =~ "en_table_structure" ]];then
        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
文幕地方's avatar
文幕地方 已提交
529 530 531 532 533 534 535 536 537 538

        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar
        if [ ${model_name} == "en_table_structure" ]; then
            wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
            tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar
        elif [ ${model_name} == "en_table_structure_PACT" ]; then
            wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_slim_infer.tar --no-check-certificate
            tar xf en_ppocr_mobile_v2.0_table_structure_slim_infer.tar
        fi
        cd ../
A
andyjpaddle 已提交
539
    fi
文幕地方's avatar
文幕地方 已提交
540 541 542 543 544 545 546 547 548 549 550 551
    if [[ ${model_name} =~ "slanet" ]];then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_infer.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
        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 en_ppstructure_mobile_v2.0_SLANet_infer.tar && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
    fi
    if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
        ${python_name} -m pip install -r ppstructure/kie/requirements.txt
        ${python_name} -m pip install opencv-python -U 
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_infer.tar --no-check-certificate
        cd ./inference/ && tar xf ser_vi_layoutxlm_xfund_infer.tar & cd ../
    fi
文幕地方's avatar
文幕地方 已提交
552 553 554 555 556 557
    if [[ ${model_name} =~ "layoutxlm_ser" ]]; then
        ${python_name} -m pip install -r ppstructure/kie/requirements.txt
        ${python_name} -m pip install opencv-python -U 
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh_infer.tar --no-check-certificate
        cd ./inference/ && tar xf ser_LayoutXLM_xfun_zh_infer.tar & cd ../
    fi
L
LDOUBLEV 已提交
558
fi
L
LDOUBLEV 已提交
559

A
andyjpaddle 已提交
560
if [[ ${model_name} =~ "KL" ]]; then
L
LDOUBLEV 已提交
561
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
L
LDOUBLEV 已提交
562
    cd ./train_data/ && tar xf icdar2015_lite.tar && rm -rf ./icdar2015 && ln -s ./icdar2015_lite ./icdar2015 && cd ../
文幕地方's avatar
文幕地方 已提交
563
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
L
LDOUBLEV 已提交
564 565 566
        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 已提交
567
    fi
A
andyjpaddle 已提交
568
    if [ ${model_name} = "ch_PP-OCRv2_rec_KL" ]; then
L
reset  
LDOUBLEV 已提交
569 570
        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
571 572
        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 已提交
573 574
        cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
    fi
A
andyjpaddle 已提交
575
    if [ ${model_name} = "ch_PP-OCRv3_rec_KL" ]; then
576 577 578
        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 已提交
579 580 581 582
        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 ../
583 584
        cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
    fi
A
andyjpaddle 已提交
585
    if [ ${model_name} = "ch_PP-OCRv2_det_KL" ]; then
L
LDOUBLEV 已提交
586
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
L
reset  
LDOUBLEV 已提交
587 588
        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 已提交
589
    fi 
A
andyjpaddle 已提交
590
    if [ ${model_name} = "ch_PP-OCRv3_det_KL" ]; then
591 592 593 594
        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
文幕地方 已提交
595
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
文幕地方's avatar
文幕地方 已提交
596 597 598 599 600
        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 已提交
601 602 603 604 605 606 607 608 609
    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
文幕地方's avatar
文幕地方 已提交
610 611 612 613 614 615
    if [[ ${model_name} =~ "layoutxlm_ser_KL" ]]; then
        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 ../
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh_infer.tar --no-check-certificate
        cd ./inference/ && tar xf ser_LayoutXLM_xfun_zh_infer.tar & cd ../
    fi
L
fix bug  
LDOUBLEV 已提交
616 617 618
fi

if [ ${MODE} = "cpp_infer" ];then
文幕地方's avatar
文幕地方 已提交
619
    if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
L
LDOUBLEV 已提交
620 621
        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 已提交
622
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
文幕地方's avatar
文幕地方 已提交
623
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
A
andyjpaddle 已提交
624 625 626
        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
文幕地方 已提交
627
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
A
andyjpaddle 已提交
628 629 630
        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
文幕地方 已提交
631
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec" ]; then
A
andyjpaddle 已提交
632 633 634
        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
文幕地方 已提交
635
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
A
andyjpaddle 已提交
636 637 638
        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
文幕地方 已提交
639
    elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
A
andyjpaddle 已提交
640 641 642
        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
文幕地方 已提交
643
    elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
A
andyjpaddle 已提交
644 645 646
        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
文幕地方 已提交
647
    elif [ ${model_name} = "ch_ppocr_server_v2_0_rec" ]; then
A
andyjpaddle 已提交
648 649 650 651 652 653 654
        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 已提交
655 656 657 658 659 660 661 662
    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 已提交
663 664 665 666
    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 已提交
667 668 669 670 671 672 673 674
    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 已提交
675
    elif [ ${model_name} = "ch_PP-OCRv3_det" ]; then
676 677 678
        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 已提交
679 680 681 682 683 684 685 686
    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 已提交
687
    elif [ ${model_name} = "ch_PP-OCRv3_rec" ]; then
688 689 690
        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 已提交
691 692 693 694 695 696 697 698
    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
文幕地方 已提交
699
    elif  [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
L
LDOUBLEV 已提交
700 701 702
        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 已提交
703
        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
文幕地方 已提交
704
    elif  [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
A
andyjpaddle 已提交
705 706 707 708 709 710 711 712 713 714
        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
715 716 717 718
        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 ../
文幕地方's avatar
文幕地方 已提交
719
    elif [[ ${model_name} =~ "en_table_structure" ]];then
文幕地方's avatar
文幕地方 已提交
720 721
        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
722 723 724 725 726 727 728 729 730 731

        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar
        if [ ${model_name} == "en_table_structure" ]; then
            wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
            tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar
        elif [ ${model_name} == "en_table_structure_PACT" ]; then
            wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_slim_infer.tar --no-check-certificate
            tar xf en_ppocr_mobile_v2.0_table_structure_slim_infer.tar
        fi
        cd ../
文幕地方's avatar
文幕地方 已提交
732 733 734 735 736
    elif [[ ${model_name} =~ "slanet" ]];then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.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
        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_ppstructure_mobile_v2.0_SLANet_infer.tar && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
文幕地方's avatar
文幕地方 已提交
737
    fi
D
Double_V 已提交
738
fi
T
tink2123 已提交
739

T
tink2123 已提交
740 741
if [ ${MODE} = "serving_infer" ];then
    # prepare serving env
T
tink2123 已提交
742 743 744 745
    python_name_list=$(func_parser_value "${lines[2]}")
    IFS='|'
    array=(${python_name_list})
    python_name=${array[0]}
A
andyjpaddle 已提交
746 747 748
    ${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
文幕地方's avatar
文幕地方 已提交
749
    ${python_name} -m pip install https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl
A
andyjpaddle 已提交
750
    # wget model
文幕地方's avatar
文幕地方 已提交
751
    if [ ${model_name} == "ch_ppocr_mobile_v2_0_det_KL" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_KL" ] ; then
A
andyjpaddle 已提交
752 753 754 755 756 757 758 759 760 761 762
        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
文幕地方 已提交
763
    elif [ ${model_name} == "ch_ppocr_mobile_v2_0_det_PACT" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_PACT" ] ; then
A
andyjpaddle 已提交
764 765 766 767 768 769 770 771 772 773 774
        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
文幕地方 已提交
775
    elif [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
A
andyjpaddle 已提交
776 777 778
        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
文幕地方 已提交
779
    elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
A
andyjpaddle 已提交
780 781 782 783 784 785 786 787 788 789 790 791 792
        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 已提交
793
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
794
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar  --no-check-certificate
A
andyjpaddle 已提交
795
    cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
T
tink2123 已提交
796
fi
C
cuicheng01 已提交
797

T
tink2123 已提交
798 799 800
if [ ${MODE} = "paddle2onnx_infer" ];then
    # prepare serving env
    python_name=$(func_parser_value "${lines[2]}")
文幕地方's avatar
文幕地方 已提交
801
    ${python_name} -m pip install paddle2onnx onnxruntime onnx
T
tink2123 已提交
802
    # wget model
文幕地方's avatar
文幕地方 已提交
803
    if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
A
andyjpaddle 已提交
804 805 806
        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
文幕地方 已提交
807
    elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
A
andyjpaddle 已提交
808 809 810 811 812 813 814 815 816 817 818
        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 ../
文幕地方's avatar
文幕地方 已提交
819 820 821
    elif [[ ${model_name} =~ "slanet" ]];then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.tar --no-check-certificate
        cd ./inference/ && tar xf ch_ppstructure_mobile_v2.0_SLANet_infer.tar && cd ../
822 823 824
    elif [[ ${model_name} =~ "en_table_structure" ]];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
        cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar && cd ../
A
andyjpaddle 已提交
825 826
    fi
    
T
tink2123 已提交
827 828 829
    # 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 已提交
830
    cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
T
tink2123 已提交
831 832
    
fi