prepare.sh 19.8 KB
Newer Older
LDOUBLEV's avatar
LDOUBLEV committed
1
#!/bin/bash
MissPenguin's avatar
MissPenguin committed
2
3
source test_tipc/common_func.sh

LDOUBLEV's avatar
LDOUBLEV committed
4
FILENAME=$1
5

LDOUBLEV's avatar
rename  
LDOUBLEV committed
6
7
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer',  
#                 'whole_infer', 'klquant_whole_infer',
cuicheng01's avatar
cuicheng01 committed
8
#                 'cpp_infer', 'serving_infer']
LDOUBLEV's avatar
LDOUBLEV committed
9

LDOUBLEV's avatar
LDOUBLEV committed
10
11
12
13
14
15
16
MODE=$2

dataline=$(cat ${FILENAME})

# parser params
IFS=$'\n'
lines=(${dataline})
MissPenguin's avatar
MissPenguin committed
17

LDOUBLEV's avatar
LDOUBLEV committed
18
# The training params
LDOUBLEV's avatar
LDOUBLEV committed
19
model_name=$(func_parser_value "${lines[1]}")
LDOUBLEV's avatar
LDOUBLEV committed
20

LDOUBLEV's avatar
LDOUBLEV committed
21
trainer_list=$(func_parser_value "${lines[14]}")
Double_V's avatar
Double_V committed
22

LDOUBLEV's avatar
LDOUBLEV committed
23

LDOUBLEV's avatar
rename  
LDOUBLEV committed
24
if [ ${MODE} = "lite_train_lite_infer" ];then
Double_V's avatar
Double_V committed
25
    # pretrain lite train data
LDOUBLEV's avatar
LDOUBLEV committed
26
27
    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
LDOUBLEV's avatar
LDOUBLEV committed
28
    if [[ ${model_name} =~ "PPOCRv2_det" ]];then
LDOUBLEV's avatar
LDOUBLEV committed
29
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
30
31
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
LDOUBLEV's avatar
LDOUBLEV committed
32
    cd ./pretrain_models/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
Double_V's avatar
Double_V committed
33
    rm -rf ./train_data/icdar2015
tink2123's avatar
tink2123 committed
34
    rm -rf ./train_data/ic15_data
LDOUBLEV's avatar
LDOUBLEV committed
35
36
37
38
    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
LDOUBLEV's avatar
LDOUBLEV committed
39
    
tink2123's avatar
tink2123 committed
40
    cd ./train_data/ && tar xf icdar2015_lite.tar && tar xf ic15_data.tar
Double_V's avatar
Double_V committed
41
42
    ln -s ./icdar2015_lite ./icdar2015
    cd ../
tink2123's avatar
tink2123 committed
43
    cd ./inference && tar xf rec_inference.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
44
    if [ ${model_name} == "en_server_pgnetA" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
45
46
47
        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 ../
LDOUBLEV's avatar
LDOUBLEV committed
48
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
49
    fi
LDOUBLEV's avatar
LDOUBLEV committed
50
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2.0" ] || [ ${model_name} == "det_r50_vd_sast_totaltext_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
51
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
52
        wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
53
        cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text  && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
54
    fi
55
    if [ ${model_name} == "det_mv3_db_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
56
57
        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 ../
58
59
60
    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
LDOUBLEV's avatar
LDOUBLEV committed
61
62
        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 ../
63
    fi
WenmuZhou's avatar
WenmuZhou committed
64
65
66
67
    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
LDOUBLEV's avatar
LDOUBLEV committed
68

LDOUBLEV's avatar
rename  
LDOUBLEV committed
69
elif [ ${MODE} = "whole_train_whole_infer" ];then
LDOUBLEV's avatar
LDOUBLEV committed
70
    wget -nc -P  ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
Double_V's avatar
Double_V committed
71
    rm -rf ./train_data/icdar2015
tink2123's avatar
tink2123 committed
72
    rm -rf ./train_data/ic15_data
LDOUBLEV's avatar
LDOUBLEV committed
73
74
    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
tink2123's avatar
tink2123 committed
75
    cd ./train_data/ && tar xf icdar2015.tar && tar xf ic15_data.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
76
    if [ ${model_name} == "ch_PPOCRv2_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
77
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
78
79
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
LDOUBLEV's avatar
LDOUBLEV committed
80
    if [ ${model_name} == "en_server_pgnetA" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
81
        wget -nc -P ./train_data/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar  --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
82
83
        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 ../
LDOUBLEV's avatar
LDOUBLEV committed
84
        cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text  && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
85
    fi
LDOUBLEV's avatar
LDOUBLEV committed
86
    if [ ${model_name} == "det_r50_vd_sast_totaltext_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
87
        wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
88
89
        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 ../
LDOUBLEV's avatar
LDOUBLEV committed
90
    fi
LDOUBLEV's avatar
rename  
LDOUBLEV committed
91
elif [ ${MODE} = "lite_train_whole_infer" ];then
LDOUBLEV's avatar
LDOUBLEV committed
92
    wget -nc -P  ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
Double_V's avatar
Double_V committed
93
    rm -rf ./train_data/icdar2015
tink2123's avatar
tink2123 committed
94
    rm -rf ./train_data/ic15_data
LDOUBLEV's avatar
LDOUBLEV committed
95
96
    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
tink2123's avatar
tink2123 committed
97
    cd ./train_data/ && tar xf icdar2015_infer.tar && tar xf ic15_data.tar
Double_V's avatar
Double_V committed
98
99
    ln -s ./icdar2015_infer ./icdar2015
    cd ../
LDOUBLEV's avatar
LDOUBLEV committed
100
    if [ ${model_name} == "ch_PPOCRv2_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
101
        wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
102
103
        cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
    fi
LDOUBLEV's avatar
rename  
LDOUBLEV committed
104
elif [ ${MODE} = "whole_infer" ];then
LDOUBLEV's avatar
LDOUBLEV committed
105
    wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
andyjpaddle's avatar
andyjpaddle committed
106
107
    wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
    cd ./inference && tar xf rec_inference.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
108
    if [ ${model_name} = "ch_ppocr_mobile_v2.0_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
109
        eval_model_name="ch_ppocr_mobile_v2.0_det_train"
tink2123's avatar
tink2123 committed
110
        rm -rf ./train_data/icdar2015
LDOUBLEV's avatar
LDOUBLEV committed
111
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
112
113
        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 ../
andyjpaddle's avatar
andyjpaddle committed
114
115
116
117
    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 ../
LDOUBLEV's avatar
LDOUBLEV committed
118
    elif [ ${model_name} = "ch_ppocr_server_v2.0_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
119
        wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
120
        cd ./inference && tar xf ch_ppocr_server_v2.0_det_train.tar && tar xf ch_det_data_50.tar && cd ../
121
    elif  [ ${model_name} = "ch_ppocr_mobile_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
122
123
        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
LDOUBLEV's avatar
LDOUBLEV committed
124
        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 ../
125
    elif  [ ${model_name} = "ch_ppocr_server_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
126
127
        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
tink2123's avatar
tink2123 committed
128
        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 ../
tink2123's avatar
tink2123 committed
129
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec" ]; then
tink2123's avatar
tink2123 committed
130
        eval_model_name="ch_ppocr_mobile_v2.0_rec_infer"
LDOUBLEV's avatar
LDOUBLEV committed
131
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
andyjpaddle's avatar
andyjpaddle committed
132
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
tink2123's avatar
tink2123 committed
133
    elif [ ${model_name} = "ch_ppocr_server_v2.0_rec" ]; then
134
        eval_model_name="ch_ppocr_server_v2.0_rec_infer"
LDOUBLEV's avatar
LDOUBLEV committed
135
        wget -nc  -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
andyjpaddle's avatar
andyjpaddle committed
136
137
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec_PACT" ]; then
andyjpaddle's avatar
andyjpaddle committed
138
139
        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
andyjpaddle's avatar
andyjpaddle committed
140
141
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec_FPGM" ]; then
andyjpaddle's avatar
andyjpaddle committed
142
143
        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
andyjpaddle's avatar
andyjpaddle committed
144
        cd ./inference && tar xf ${eval_model_name}.tar && cd ../
Double_V's avatar
Double_V committed
145
    fi 
andyjpaddle's avatar
andyjpaddle committed
146
    if [[ ${model_name} =~ "ch_PPOCRv2_det" ]]; then
LDOUBLEV's avatar
LDOUBLEV committed
147
        eval_model_name="ch_PP-OCRv2_det_infer"
LDOUBLEV's avatar
LDOUBLEV committed
148
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
LDOUBLEV's avatar
LDOUBLEV committed
149
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
andyjpaddle's avatar
andyjpaddle committed
150
    fi
andyjpaddle's avatar
andyjpaddle committed
151
    if [[ ${model_name} =~ "PPOCRv2_ocr_rec" ]]; then
andyjpaddle's avatar
andyjpaddle committed
152
153
        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
andyjpaddle's avatar
andyjpaddle committed
154
155
        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 ../
andyjpaddle's avatar
andyjpaddle committed
156
    fi   
LDOUBLEV's avatar
LDOUBLEV committed
157
    if [ ${model_name} == "en_server_pgnetA" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
158
        wget -nc -P ./inference/  https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar  --no-check-certificate
andyjpaddle's avatar
andyjpaddle committed
159
        cd ./inference && tar xf en_server_pgnetA.tar && tar xf ch_det_data_50.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
160
    fi
LDOUBLEV's avatar
LDOUBLEV committed
161
    if [ ${model_name} == "det_r50_vd_sast_icdar15_v2.0" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
162
        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
andyjpaddle's avatar
andyjpaddle committed
163
        cd ./inference/ && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
164
    fi
tink2123's avatar
tink2123 committed
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
    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
        cd ./inference/ && tar rec_mv3_none_none_ctc_v2.0_train.tar && cd ../
    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
        cd ./inference/ && tar rec_r34_vd_none_none_ctc_v2.0_train.tar && cd ../
    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
        cd ./inference/ && tar rec_mv3_none_bilstm_ctc_v2.0_train.tar && cd ../
    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
        cd ./inference/ && tar rec_r34_vd_none_bilstm_ctc_v2.0_train.tar && cd ../
    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
        cd ./inference/ && tar rec_mv3_tps_bilstm_ctc_v2.0_train.tar && cd ../
    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
        cd ./inference/ && tar rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar && cd ../
    fi
    if [ ${model_name} == "ch_ppocr_server_v2.0_rec" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/ch_ppocr_server_v2.0_rec_train.tar --no-check-certificate
        cd ./inference/ && tar ch_ppocr_server_v2.0_rec_train.tar && cd ../
    fi
    
194
195
    if [ ${model_name} == "det_mv3_db_v2.0" ]; then
        wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar  --no-check-certificate
andyjpaddle's avatar
andyjpaddle committed
196
        cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
197
198
199
    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
andyjpaddle's avatar
andyjpaddle committed
200
        cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
LDOUBLEV's avatar
LDOUBLEV committed
201
    fi
LDOUBLEV's avatar
LDOUBLEV committed
202
fi
LDOUBLEV's avatar
fix bug  
LDOUBLEV committed
203
if [ ${MODE} = "klquant_whole_infer" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
204
205
206
    wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
    cd ./train_data/ && tar xf icdar2015_lite.tar
    ln -s ./icdar2015_lite ./icdar2015 && cd ../
LDOUBLEV's avatar
fix kl  
LDOUBLEV committed
207
    if [ ${model_name} = "ch_ppocr_mobile_v2.0_det_KL" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
208
209
210
        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 ../ 
LDOUBLEV's avatar
LDOUBLEV committed
211
    fi
LDOUBLEV's avatar
LDOUBLEV committed
212
    if [ ${model_name} = "ch_PPOCRv2_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
213
        eval_model_name="ch_PP-OCRv2_det_infer"
LDOUBLEV's avatar
LDOUBLEV committed
214
215
        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
LDOUBLEV's avatar
LDOUBLEV committed
216
217
        cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
    fi 
WenmuZhou's avatar
WenmuZhou committed
218
219
220
221
222
223
224
    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 
LDOUBLEV's avatar
fix bug  
LDOUBLEV committed
225
226
227
fi

if [ ${MODE} = "cpp_infer" ];then
MissPenguin's avatar
MissPenguin committed
228
    if [ ${model_name} = "ocr_det" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
229
230
        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
MissPenguin's avatar
MissPenguin committed
231
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
tink2123's avatar
tink2123 committed
232
    elif [ ${model_name} = "ch_ppocr_mobile_v2.0_rec" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
233
234
        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
MissPenguin's avatar
MissPenguin committed
235
236
        cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
    elif  [ ${model_name} = "ocr_system" ]; then
LDOUBLEV's avatar
LDOUBLEV committed
237
238
239
        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
MissPenguin's avatar
MissPenguin committed
240
241
        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 
Double_V's avatar
Double_V committed
242
fi
tink2123's avatar
tink2123 committed
243

tink2123's avatar
tink2123 committed
244
245
if [ ${MODE} = "serving_infer" ];then
    # prepare serving env
tink2123's avatar
tink2123 committed
246
247
248
249
250
    python_name_list=$(func_parser_value "${lines[2]}")
    IFS='|'
    array=(${python_name_list})
    python_name=${array[0]}
    wget -nc https://paddle-serving.bj.bcebos.com/chain/paddle_serving_server_gpu-0.0.0.post101-py3-none-any.whl
251
    ${python_name} -m pip install install paddle_serving_server_gpu-0.0.0.post101-py3-none-any.whl
tink2123's avatar
tink2123 committed
252
    ${python_name} -m pip install paddle_serving_client==0.6.1
253
    ${python_name} -m pip install paddle-serving-app==0.6.3
tink2123's avatar
tink2123 committed
254
255
    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
256
257
    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
tink2123's avatar
tink2123 committed
258
    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 ../
tink2123's avatar
tink2123 committed
259
fi
cuicheng01's avatar
cuicheng01 committed
260

tink2123's avatar
tink2123 committed
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
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