prepare.sh 25.1 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
L
LDOUBLEV 已提交
25
    if [[ ${model_name} =~ "det_mv3_db_v2_0" || ${model_name} =~ "det_r50_vd_east_v2_0" || ${model_name} =~ "det_r50_vd_pse_v2_0" || ${model_name} =~ "det_r18_db_v2_0" ]];then
L
LDOUBLEV 已提交
26
        rm -rf ./train_data/icdar2015
L
LDOUBLEV 已提交
27 28 29 30 31 32 33 34 35 36 37
        wget -nc -P  ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams  --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015.tar && cd ../
    fi
    if [[ ${model_name} =~ "det_r50_vd_east_v2_0" || ${model_name} =~ "det_r50_vd_pse_v2_0" ]];then
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015.tar && cd ../
    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
L
LDOUBLEV 已提交
38 39 40 41
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar --no-check-certificate
        cd ./train_data/ && tar xf icdar2015.tar && cd ../
    fi
fi
L
LDOUBLEV 已提交
42

L
rename  
LDOUBLEV 已提交
43
if [ ${MODE} = "lite_train_lite_infer" ];then
D
Double_V 已提交
44
    # pretrain lite train data
L
LDOUBLEV 已提交
45 46
    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
L
LDOUBLEV 已提交
47
    if [[ ${model_name} =~ "PPOCRv2_det" ]];then
L
LDOUBLEV 已提交
48
        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 已提交
49 50
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
L
LDOUBLEV 已提交
51
    cd ./pretrain_models/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
D
Double_V 已提交
52
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
53
    rm -rf ./train_data/ic15_data
L
LDOUBLEV 已提交
54 55 56 57
    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
    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 已提交
58
    
T
tink2123 已提交
59
    cd ./train_data/ && tar xf icdar2015_lite.tar && tar xf ic15_data.tar
D
Double_V 已提交
60 61
    ln -s ./icdar2015_lite ./icdar2015
    cd ../
T
tink2123 已提交
62
    cd ./inference && tar xf rec_inference.tar && cd ../
L
LDOUBLEV 已提交
63 64 65
    if [ ${model_name} == "ch_PPOCRv2_det" ] || [ ${model_name} == "ch_PPOCRv2_det_PACT" ]; 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 ../
L
LDOUBLEV 已提交
66
    fi
L
LDOUBLEV 已提交
67 68 69 70
    if [ ${model_name} == "ch_PPOCRv2_rec" ] || [ ${model_name} == "ch_PPOCRv2_rec_PACT" ]; then
        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
L
LDOUBLEV 已提交
71
    if [ ${model_name} == "det_r18_db_v2_0" ]; then
L
LDOUBLEV 已提交
72 73
        wget -nc -P ./pretrain_models/  https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams  --no-check-certificate
    fi
L
LDOUBLEV 已提交
74
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
75 76 77
        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 已提交
78
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
L
LDOUBLEV 已提交
79
    fi
L
LDOUBLEV 已提交
80
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2.0" ] || [ ${model_name} == "det_r50_vd_sast_totaltext_v2.0" ]; then
L
LDOUBLEV 已提交
81
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
82
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
L
LDOUBLEV 已提交
83
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text  && cd ../
L
LDOUBLEV 已提交
84
    fi
L
LDOUBLEV 已提交
85
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
L
LDOUBLEV 已提交
86 87
        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 ../
88 89 90
    fi
    if [ ${model_name} == "det_r50_db_v2.0" ]; then
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
91 92
        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 ../
93
    fi
文幕地方's avatar
文幕地方 已提交
94 95 96 97
    if [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_FPGM" ]; then
        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
L
LDOUBLEV 已提交
98 99 100 101
    if [ ${model_name} == "det_mv3_east_v2.0" ]; then
        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
L
LDOUBLEV 已提交
102

L
rename  
LDOUBLEV 已提交
103
elif [ ${MODE} = "whole_train_whole_infer" ];then
L
LDOUBLEV 已提交
104
    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 已提交
105
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
106
    rm -rf ./train_data/ic15_data
L
LDOUBLEV 已提交
107 108
    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
T
tink2123 已提交
109
    cd ./train_data/ && tar xf icdar2015.tar && tar xf ic15_data.tar && cd ../
L
LDOUBLEV 已提交
110
    if [ ${model_name} == "ch_PPOCRv2_det" ]; then
L
LDOUBLEV 已提交
111
        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 已提交
112 113
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
L
LDOUBLEV 已提交
114
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
115
        wget -nc -P ./train_data/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar  --no-check-certificate
L
LDOUBLEV 已提交
116 117
        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 已提交
118
        cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text  && cd ../
L
LDOUBLEV 已提交
119
    fi
L
LDOUBLEV 已提交
120
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2.0" ]; then
L
LDOUBLEV 已提交
121
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
L
LDOUBLEV 已提交
122 123
        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 已提交
124
    fi
L
rename  
LDOUBLEV 已提交
125
elif [ ${MODE} = "lite_train_whole_infer" ];then
L
LDOUBLEV 已提交
126
    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 已提交
127
    rm -rf ./train_data/icdar2015
T
tink2123 已提交
128
    rm -rf ./train_data/ic15_data
L
LDOUBLEV 已提交
129 130
    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
T
tink2123 已提交
131
    cd ./train_data/ && tar xf icdar2015_infer.tar && tar xf ic15_data.tar
D
Double_V 已提交
132 133
    ln -s ./icdar2015_infer ./icdar2015
    cd ../
L
LDOUBLEV 已提交
134
    if [ ${model_name} == "ch_PPOCRv2_det" ]; then
L
LDOUBLEV 已提交
135
        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 已提交
136 137
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
L
rename  
LDOUBLEV 已提交
138
elif [ ${MODE} = "whole_infer" ];then
L
LDOUBLEV 已提交
139
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
A
andyjpaddle 已提交
140
    wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
L
LDOUBLEV 已提交
141
    cd ./inference && tar xf rec_inference.tar  && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
142
    if [ ${model_name} = "ch_ppocr_mobile_v2.0_det" ]; then
L
LDOUBLEV 已提交
143
        eval_model_name="ch_ppocr_mobile_v2.0_det_train"
T
tink2123 已提交
144
        rm -rf ./train_data/icdar2015
L
LDOUBLEV 已提交
145
        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 已提交
146 147
        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 ../
A
andyjpaddle 已提交
148 149 150 151
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_det_PACT" ]; then
        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 ../
L
LDOUBLEV 已提交
152
    elif [ ${model_name} = "ch_ppocr_server_v2.0_det" ]; then
L
LDOUBLEV 已提交
153
        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 已提交
154
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_train.tar && tar xf ch_det_data_50.tar && cd ../
155
    elif  [ ${model_name} = "ch_ppocr_mobile_v2.0" ]; then
L
LDOUBLEV 已提交
156 157
        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 已提交
158
        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 ../
159
    elif  [ ${model_name} = "ch_ppocr_server_v2.0" ]; then
L
LDOUBLEV 已提交
160 161
        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 已提交
162
        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 ../
A
andyjpaddle 已提交
163
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec_PACT" ]; then
A
andyjpaddle 已提交
164 165
        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 已提交
166 167
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec_FPGM" ]; then
A
andyjpaddle 已提交
168 169
        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 已提交
170
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
D
Double_V 已提交
171
    fi 
A
andyjpaddle 已提交
172
    if [[ ${model_name} =~ "ch_PPOCRv2_det" ]]; then
L
LDOUBLEV 已提交
173
        eval_model_name="ch_PP-OCRv2_det_infer"
L
LDOUBLEV 已提交
174
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
L
LDOUBLEV 已提交
175
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
A
andyjpaddle 已提交
176
    fi
A
andyjpaddle 已提交
177
    if [[ ${model_name} =~ "PPOCRv2_ocr_rec" ]]; then
A
andyjpaddle 已提交
178 179
        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 已提交
180 181
        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 已提交
182
    fi   
L
LDOUBLEV 已提交
183
    if [ ${model_name} == "en_server_pgnetA" ]; then
L
LDOUBLEV 已提交
184
        wget -nc -P ./inference/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar  --no-check-certificate
A
andyjpaddle 已提交
185
        cd ./inference && tar xf en_server_pgnetA.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
186
    fi
L
LDOUBLEV 已提交
187
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2.0" ]; then
L
LDOUBLEV 已提交
188
        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 已提交
189
        cd ./inference/ && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
190
    fi
T
tink2123 已提交
191 192
    if [ ${model_name} == "rec_mv3_none_none_ctc_v2.0" ]; then
        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 已提交
193
        cd ./inference/ && tar xf rec_mv3_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
194 195 196
    fi
    if [ ${model_name} == "rec_r34_vd_none_none_ctc_v2.0" ]; then
        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 已提交
197
        cd ./inference/ && tar xf rec_r34_vd_none_none_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
198 199 200
    fi
    if [ ${model_name} == "rec_mv3_none_bilstm_ctc_v2.0" ]; then
        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 已提交
201
        cd ./inference/ && tar xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
202 203 204
    fi
    if [ ${model_name} == "rec_r34_vd_none_bilstm_ctc_v2.0" ]; then
        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 已提交
205
        cd ./inference/ && tar xf rec_r34_vd_none_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
206 207 208
    fi
    if [ ${model_name} == "rec_mv3_tps_bilstm_ctc_v2.0" ]; then
        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 已提交
209
        cd ./inference/ && tar xf rec_mv3_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
210 211 212
    fi
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_ctc_v2.0" ]; then
        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 已提交
213
        cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar && cd ../
T
tink2123 已提交
214 215
    fi
    if [ ${model_name} == "ch_ppocr_server_v2.0_rec" ]; then
L
LDOUBLEV 已提交
216
        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 已提交
217
        cd ./inference/ && tar xf ch_ppocr_server_v2.0_rec_train.tar && cd ../
T
tink2123 已提交
218
    fi
A
andyjpaddle 已提交
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
    if [ ${model_name} == "ch_ppocr_mobile_v2.0_rec" ]; then
        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
    if [ ${model_name} == "rec_mv3_tps_bilstm_att_v2.0" ]; then
        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
    if [ ${model_name} == "rec_r34_vd_tps_bilstm_att_v2.0" ]; then
        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 已提交
243
    
L
LDOUBLEV 已提交
244 245 246 247
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2.0" ]; then
        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 已提交
248
    if [ ${model_name} == "det_mv3_db_v2_0" ]; then
249
        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 已提交
250
        cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
251 252 253
    fi
    if [ ${model_name} == "det_r50_db_v2.0" ]; then
        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 已提交
254
        cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
L
LDOUBLEV 已提交
255
    fi
L
LDOUBLEV 已提交
256 257 258 259
    if [ ${model_name} == "det_mv3_pse_v2.0" ]; then
        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 已提交
260
    if [ ${model_name} == "det_r50_vd_pse_v2_0" ]; then
L
LDOUBLEV 已提交
261 262 263 264 265 266 267
        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
    if [ ${model_name} == "det_mv3_east_v2.0" ]; then
        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 已提交
268
    if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
L
LDOUBLEV 已提交
269 270
        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 已提交
271
    fi
L
LDOUBLEV 已提交
272
fi
L
LDOUBLEV 已提交
273

L
fix bug  
LDOUBLEV 已提交
274
if [ ${MODE} = "klquant_whole_infer" ]; then
L
LDOUBLEV 已提交
275
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
L
LDOUBLEV 已提交
276
    cd ./train_data/ && tar xf icdar2015_lite.tar && rm -rf ./icdar2015 && ln -s ./icdar2015_lite ./icdar2015 && cd ../
L
fix kl  
LDOUBLEV 已提交
277
    if [ ${model_name} = "ch_ppocr_mobile_v2.0_det_KL" ]; then
L
LDOUBLEV 已提交
278 279 280
        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 已提交
281
    fi
L
reset  
LDOUBLEV 已提交
282 283 284
    if [ ${model_name} = "PPOCRv2_ocr_rec_kl" ]; then
        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
285 286
        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 已提交
287 288 289
        cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
    fi
    if [ ${model_name} = "PPOCRv2_ocr_det_kl" ]; then
L
LDOUBLEV 已提交
290
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar  --no-check-certificate
L
reset  
LDOUBLEV 已提交
291 292
        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 已提交
293
    fi 
文幕地方's avatar
文幕地方 已提交
294 295 296 297 298 299 300
    if [ ${model_name} = "ch_ppocr_mobile_v2.0_rec_KL" ]; then
        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 ../ 
    fi 
L
fix bug  
LDOUBLEV 已提交
301 302 303
fi

if [ ${MODE} = "cpp_infer" ];then
M
MissPenguin 已提交
304
    if [ ${model_name} = "ocr_det" ]; then
L
LDOUBLEV 已提交
305 306
        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 已提交
307
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
T
tink2123 已提交
308
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec" ]; then
L
LDOUBLEV 已提交
309 310
        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
M
MissPenguin 已提交
311 312
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
    elif  [ ${model_name} = "ocr_system" ]; then
L
LDOUBLEV 已提交
313 314 315
        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 已提交
316 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 ../
    fi 
D
Double_V 已提交
318
fi
T
tink2123 已提交
319

T
tink2123 已提交
320 321
if [ ${MODE} = "serving_infer" ];then
    # prepare serving env
T
tink2123 已提交
322 323 324 325
    python_name_list=$(func_parser_value "${lines[2]}")
    IFS='|'
    array=(${python_name_list})
    python_name=${array[0]}
T
tink2123 已提交
326 327 328
    ${python_name} -m pip install paddle-serving-server-gpu==0.8.3.post101
    ${python_name} -m pip install paddle_serving_client==0.8.3
    ${python_name} -m pip install paddle-serving-app==0.8.3
T
tink2123 已提交
329 330
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar
331 332
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar
T
tink2123 已提交
333
    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_ppocr_server_v2.0_rec_infer.tar && tar xf ch_ppocr_server_v2.0_det_infer.tar && cd ../
T
tink2123 已提交
334
fi
C
cuicheng01 已提交
335

T
tink2123 已提交
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
if [ ${MODE} = "paddle2onnx_infer" ];then
    # prepare serving env
    python_name=$(func_parser_value "${lines[2]}")
    ${python_name} -m pip install install paddle2onnx
    ${python_name} -m pip install onnxruntime==1.4.0
    # wget model
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar
    wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar
    # 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
    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_ppocr_server_v2.0_rec_infer.tar && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
    
fi