prepare.sh 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. #!/bin/bash
  2. source test_tipc/common_func.sh
  3. FILENAME=$1
  4. # MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer',
  5. # 'whole_infer', 'klquant_whole_infer',
  6. # 'cpp_infer', 'serving_infer']
  7. MODE=$2
  8. dataline=$(cat ${FILENAME})
  9. # parser params
  10. IFS=$'\n'
  11. lines=(${dataline})
  12. # The training params
  13. model_name=$(func_parser_value "${lines[1]}")
  14. trainer_list=$(func_parser_value "${lines[14]}")
  15. if [ ${MODE} = "benchmark_train" ];then
  16. python_name_list=$(func_parser_value "${lines[2]}")
  17. array=(${python_name_list})
  18. python_name=${array[0]}
  19. ${python_name} -m pip install -r requirements.txt
  20. if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_det" || ${model_name} =~ "det_mv3_db_v2_0" ]];then
  21. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
  22. rm -rf ./train_data/icdar2015
  23. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  24. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  25. ln -s ./icdar2015_benckmark ./icdar2015
  26. cd ../
  27. if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0_det" ]];then
  28. # expand gt.txt 2 times
  29. cd ./train_data/icdar2015/text_localization
  30. for i in `seq 2`;do cp train_icdar2015_label.txt dup$i.txt;done
  31. cat dup* > train_icdar2015_label.txt && rm -rf dup*
  32. cd ../../../
  33. fi
  34. fi
  35. if [[ ${model_name} =~ "ch_ppocr_server_v2_0_det" || ${model_name} =~ "ch_PP-OCRv3_det" ]];then
  36. rm -rf ./train_data/icdar2015
  37. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  38. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  39. ln -s ./icdar2015_benckmark ./icdar2015
  40. cd ../
  41. fi
  42. if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]];then
  43. 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
  44. cd ./pretrain_models/ && tar xf ch_ppocr_server_v2.0_det_train.tar && cd ../
  45. rm -rf ./train_data/icdar2015
  46. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  47. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  48. ln -s ./icdar2015_benckmark ./icdar2015
  49. cd ../
  50. fi
  51. if [[ ${model_name} =~ "det_r50_vd_east_v2_0" ]]; then
  52. 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
  53. cd ./pretrain_models/ && tar xf det_r50_vd_east_v2.0_train.tar && cd ../
  54. rm -rf ./train_data/icdar2015
  55. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  56. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  57. ln -s ./icdar2015_benckmark ./icdar2015
  58. cd ../
  59. fi
  60. if [[ ${model_name} =~ "det_r50_db_v2_0" || ${model_name} =~ "det_r50_vd_pse_v2_0" ]];then
  61. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
  62. rm -rf ./train_data/icdar2015
  63. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  64. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  65. ln -s ./icdar2015_benckmark ./icdar2015
  66. cd ../
  67. fi
  68. if [[ ${model_name} =~ "det_r18_db_v2_0" ]];then
  69. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams --no-check-certificate
  70. rm -rf ./train_data/icdar2015
  71. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  72. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  73. ln -s ./icdar2015_benckmark ./icdar2015
  74. cd ../
  75. fi
  76. 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
  77. rm -rf ./train_data/ic15_data
  78. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ic15_data_benckmark.tar --no-check-certificate
  79. cd ./train_data/ && tar xf ic15_data_benckmark.tar
  80. ln -s ./ic15_data_benckmark ./ic15_data
  81. cd ../
  82. fi
  83. if [[ ${model_name} =~ "ch_PP-OCRv2_rec" || ${model_name} =~ "ch_PP-OCRv3_rec" ]];then
  84. rm -rf ./train_data/ic15_data
  85. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ic15_data_benckmark.tar --no-check-certificate
  86. cd ./train_data/ && tar xf ic15_data_benckmark.tar
  87. ln -s ./ic15_data_benckmark ./ic15_data
  88. cd ic15_data
  89. mv rec_gt_train4w.txt rec_gt_train.txt
  90. cd ../
  91. cd ../
  92. fi
  93. if [[ ${model_name} == "en_table_structure" ]];then
  94. 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
  95. cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar && cd ../
  96. rm -rf ./train_data/pubtabnet
  97. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet_benckmark.tar --no-check-certificate
  98. cd ./train_data/ && tar xf pubtabnet_benckmark.tar
  99. ln -s ./pubtabnet_benckmark ./pubtabnet
  100. cd ../
  101. fi
  102. if [[ ${model_name} == "slanet" ]];then
  103. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar --no-check-certificate
  104. cd ./pretrain_models/ && tar xf en_ppstructure_mobile_v2.0_SLANet_train.tar && cd ../
  105. rm -rf ./train_data/pubtabnet
  106. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet_benckmark.tar --no-check-certificate
  107. cd ./train_data/ && tar xf pubtabnet_benckmark.tar
  108. ln -s ./pubtabnet_benckmark ./pubtabnet
  109. cd ../
  110. fi
  111. if [[ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]]; then
  112. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
  113. cd ./pretrain_models/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar && cd ../
  114. rm -rf ./train_data/icdar2015
  115. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/icdar2015_benckmark.tar --no-check-certificate
  116. cd ./train_data/ && tar xf icdar2015_benckmark.tar
  117. ln -s ./icdar2015_benckmark ./icdar2015
  118. cd ../
  119. fi
  120. if [ ${model_name} == "layoutxlm_ser" ] || [ ${model_name} == "vi_layoutxlm_ser" ]; then
  121. ${python_name} -m pip install -r ppstructure/kie/requirements.txt
  122. ${python_name} -m pip install opencv-python -U
  123. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
  124. cd ./train_data/ && tar xf XFUND.tar
  125. # expand gt.txt 10 times
  126. cd XFUND/zh_train
  127. for i in `seq 10`;do cp train.json dup$i.txt;done
  128. cat dup* > train.json && rm -rf dup*
  129. cd ../../
  130. cd ../
  131. fi
  132. fi
  133. if [ ${MODE} = "lite_train_lite_infer" ];then
  134. python_name_list=$(func_parser_value "${lines[2]}")
  135. array=(${python_name_list})
  136. python_name=${array[0]}
  137. ${python_name} -m pip install -r requirements.txt
  138. ${python_name} -m pip install https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl
  139. ${python_name} -m pip install paddleslim
  140. # pretrain lite train data
  141. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
  142. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar --no-check-certificate
  143. cd ./pretrain_models/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
  144. if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]];then
  145. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
  146. cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
  147. fi
  148. if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]];then
  149. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
  150. cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
  151. fi
  152. if [ ${model_name} == "en_table_structure" ] || [ ${model_name} == "en_table_structure_PACT" ];then
  153. 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
  154. cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar && cd ../
  155. 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
  156. 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
  157. 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 ../
  158. fi
  159. if [[ ${model_name} =~ "slanet" ]];then
  160. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar --no-check-certificate
  161. cd ./pretrain_models/ && tar xf en_ppstructure_mobile_v2.0_SLANet_train.tar && cd ../
  162. 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
  163. 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
  164. 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 ../
  165. fi
  166. if [[ ${model_name} =~ "det_r50_db_plusplus" ]];then
  167. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/ResNet50_dcn_asf_synthtext_pretrained.pdparams --no-check-certificate
  168. fi
  169. if [ ${model_name} == "table_master" ];then
  170. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/tablemaster/table_structure_tablemaster_train.tar --no-check-certificate
  171. cd ./pretrain_models/ && tar xf table_structure_tablemaster_train.tar && cd ../
  172. fi
  173. rm -rf ./train_data/icdar2015
  174. rm -rf ./train_data/ic15_data
  175. rm -rf ./train_data/pubtabnet
  176. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
  177. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  178. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
  179. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  180. wget -nc -P ./deploy/slim/prune https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/sen.pickle --no-check-certificate
  181. cd ./train_data/ && tar xf icdar2015_lite.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
  182. ln -s ./icdar2015_lite ./icdar2015
  183. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
  184. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
  185. mv ic15_data/rec_gt_train_lite.txt ic15_data/rec_gt_train.txt
  186. mv ic15_data/rec_gt_test_lite.txt ic15_data/rec_gt_test.txt
  187. cd ../
  188. cd ./inference && tar xf rec_inference.tar && cd ../
  189. if [ ${model_name} == "ch_PP-OCRv2_det" ] || [ ${model_name} == "ch_PP-OCRv2_det_PACT" ]; then
  190. 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
  191. cd ./pretrain_models/ && tar xf ch_ppocr_server_v2.0_det_train.tar && cd ../
  192. fi
  193. if [ ${model_name} == "ch_PP-OCRv2_rec" ] || [ ${model_name} == "ch_PP-OCRv2_rec_PACT" ]; then
  194. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_train.tar --no-check-certificate
  195. cd ./pretrain_models/ && tar xf ch_PP-OCRv2_rec_train.tar && cd ../
  196. fi
  197. if [ ${model_name} == "ch_PP-OCRv3_rec" ] || [ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]; then
  198. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_train.tar --no-check-certificate
  199. cd ./pretrain_models/ && tar xf ch_PP-OCRv3_rec_train.tar && cd ../
  200. fi
  201. if [ ${model_name} == "det_r18_db_v2_0" ]; then
  202. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams --no-check-certificate
  203. fi
  204. if [ ${model_name} == "en_server_pgnetA" ]; then
  205. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
  206. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar --no-check-certificate
  207. cd ./pretrain_models/ && tar xf en_server_pgnetA.tar && cd ../
  208. cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
  209. fi
  210. if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ] || [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
  211. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
  212. 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
  213. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
  214. cd ./train_data && tar xf total_text_lite.tar && ln -s total_text_lite total_text && cd ../
  215. cd ./pretrain_models && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && cd ../
  216. fi
  217. if [ ${model_name} == "det_mv3_db_v2_0" ]; then
  218. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar --no-check-certificate
  219. cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && cd ../
  220. fi
  221. if [ ${model_name} == "det_r50_db_v2_0" ]; then
  222. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
  223. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar --no-check-certificate
  224. cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && cd ../
  225. fi
  226. if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
  227. 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
  228. cd ./pretrain_models/ && tar xf ch_ppocr_mobile_v2.0_rec_train.tar && cd ../
  229. ${python_name} -m pip install paddleslim
  230. fi
  231. if [ ${model_name} == "ch_ppocr_mobile_v2_0_det_FPGM" ]; then
  232. ${python_name} -m pip install paddleslim
  233. fi
  234. if [ ${model_name} == "det_r50_vd_pse_v2_0" ]; then
  235. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
  236. fi
  237. if [ ${model_name} == "det_mv3_east_v2_0" ]; then
  238. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_east_v2.0_train.tar --no-check-certificate
  239. cd ./pretrain_models/ && tar xf det_mv3_east_v2.0_train.tar && cd ../
  240. fi
  241. if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
  242. 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
  243. cd ./pretrain_models/ && tar xf det_r50_vd_east_v2.0_train.tar && cd ../
  244. fi
  245. if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
  246. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
  247. cd ./pretrain_models/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar & cd ../
  248. fi
  249. if [ ${model_name} == "rec_r32_gaspin_bilstm_att" ]; then
  250. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/rec_r32_gaspin_bilstm_att_train.tar --no-check-certificate
  251. cd ./pretrain_models/ && tar xf rec_r32_gaspin_bilstm_att_train.tar && cd ../
  252. fi
  253. if [[ ${model_name} =~ "layoutxlm_ser" ]]; then
  254. ${python_name} -m pip install -r ppstructure/kie/requirements.txt
  255. ${python_name} -m pip install opencv-python -U
  256. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
  257. cd ./train_data/ && tar xf XFUND.tar
  258. cd ../
  259. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh.tar --no-check-certificate
  260. cd ./pretrain_models/ && tar xf ser_LayoutXLM_xfun_zh.tar && cd ../
  261. fi
  262. if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
  263. ${python_name} -m pip install -r ppstructure/kie/requirements.txt
  264. ${python_name} -m pip install opencv-python -U
  265. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
  266. cd ./train_data/ && tar xf XFUND.tar
  267. cd ../
  268. if [ ${model_name} == "vi_layoutxlm_ser_PACT" ]; then
  269. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_pretrained.tar --no-check-certificate
  270. cd ./pretrain_models/ && tar xf ser_vi_layoutxlm_xfund_pretrained.tar && cd ../
  271. fi
  272. fi
  273. if [ ${model_name} == "det_r18_ct" ]; then
  274. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams --no-check-certificate
  275. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/ct_tipc/total_text_lite2.tar --no-check-certificate
  276. cd ./train_data && tar xf total_text_lite2.tar && ln -s total_text_lite2 total_text && cd ../
  277. fi
  278. if [ ${model_name} == "sr_telescope" ]; then
  279. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/TextZoom.tar --no-check-certificate
  280. cd ./train_data/ && tar xf TextZoom.tar && cd ../
  281. fi
  282. if [ ${model_name} == "rec_d28_can" ]; then
  283. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/CROHME_lite.tar --no-check-certificate
  284. cd ./train_data/ && tar xf CROHME_lite.tar && cd ../
  285. fi
  286. elif [ ${MODE} = "whole_train_whole_infer" ];then
  287. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
  288. rm -rf ./train_data/icdar2015
  289. rm -rf ./train_data/ic15_data
  290. rm -rf ./train_data/pubtabnet
  291. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar --no-check-certificate
  292. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  293. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
  294. cd ./train_data/ && tar xf icdar2015.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
  295. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
  296. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
  297. cd ../
  298. if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
  299. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
  300. cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
  301. fi
  302. if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
  303. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
  304. cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
  305. fi
  306. if [ ${model_name} == "en_server_pgnetA" ]; then
  307. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
  308. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar --no-check-certificate
  309. cd ./pretrain_models/ && tar xf en_server_pgnetA.tar && cd ../
  310. cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text && cd ../
  311. fi
  312. if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
  313. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams --no-check-certificate
  314. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar --no-check-certificate
  315. cd ./train_data && tar xf total_text.tar && ln -s total_text_lite total_text && cd ../
  316. fi
  317. if [[ ${model_name} =~ "en_table_structure" ]];then
  318. 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
  319. cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar && cd ../
  320. 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
  321. 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
  322. 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 ../
  323. fi
  324. elif [ ${MODE} = "lite_train_whole_infer" ];then
  325. wget -nc -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams --no-check-certificate
  326. rm -rf ./train_data/icdar2015
  327. rm -rf ./train_data/ic15_data
  328. rm -rf ./train_data/pubtabnet
  329. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_infer.tar --no-check-certificate
  330. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  331. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
  332. cd ./train_data/ && tar xf icdar2015_infer.tar && tar xf ic15_data.tar && tar xf pubtabnet.tar
  333. ln -s ./icdar2015_infer ./icdar2015
  334. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
  335. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
  336. cd ../
  337. if [ ${model_name} == "ch_PP-OCRv2_det" ]; then
  338. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar --no-check-certificate
  339. cd ./pretrain_models/ && tar xf ch_PP-OCRv2_det_distill_train.tar && cd ../
  340. fi
  341. if [ ${model_name} == "ch_PP-OCRv3_det" ]; then
  342. wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar --no-check-certificate
  343. cd ./pretrain_models/ && tar xf ch_PP-OCRv3_det_distill_train.tar && cd ../
  344. fi
  345. if [[ ${model_name} =~ "en_table_structure" ]];then
  346. 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
  347. cd ./pretrain_models/ && tar xf en_ppocr_mobile_v2.0_table_structure_train.tar && cd ../
  348. 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
  349. 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
  350. 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 ../
  351. fi
  352. elif [ ${MODE} = "whole_infer" ];then
  353. python_name_list=$(func_parser_value "${lines[2]}")
  354. array=(${python_name_list})
  355. python_name=${array[0]}
  356. ${python_name} -m pip install paddleslim --force-reinstall
  357. ${python_name} -m pip install -r requirements.txt
  358. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  359. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  360. cd ./inference && tar xf rec_inference.tar && tar xf ch_det_data_50.tar && cd ../
  361. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
  362. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
  363. cd ./train_data/ && tar xf XFUND.tar && tar xf pubtabnet.tar && cd ../
  364. head -n 2 train_data/XFUND/zh_val/val.json > train_data/XFUND/zh_val/val_lite.json
  365. mv train_data/XFUND/zh_val/val_lite.json train_data/XFUND/zh_val/val.json
  366. if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
  367. eval_model_name="ch_ppocr_mobile_v2.0_det_train"
  368. rm -rf ./train_data/icdar2015
  369. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar --no-check-certificate
  370. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  371. 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 ../
  372. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
  373. eval_model_name="ch_ppocr_mobile_v2.0_det_prune_infer"
  374. 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
  375. cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
  376. elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
  377. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate
  378. cd ./inference && tar xf ch_ppocr_server_v2.0_det_train.tar && tar xf ch_det_data_50.tar && cd ../
  379. elif [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
  380. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  381. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  382. 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 ../
  383. elif [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
  384. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
  385. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
  386. 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 ../
  387. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
  388. eval_model_name="ch_ppocr_mobile_v2.0_rec_slim_infer"
  389. 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
  390. cd ./inference && tar xf ${eval_model_name}.tar && cd ../
  391. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_FPGM" ]; then
  392. eval_model_name="ch_PP-OCRv2_rec_infer"
  393. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  394. cd ./inference && tar xf ${eval_model_name}.tar && cd ../
  395. fi
  396. if [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
  397. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  398. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  399. 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 ../
  400. fi
  401. if [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
  402. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  403. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  404. 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 ../
  405. fi
  406. if [[ ${model_name} =~ "ch_PP-OCRv2_det" ]]; then
  407. eval_model_name="ch_PP-OCRv2_det_infer"
  408. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  409. cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
  410. fi
  411. if [[ ${model_name} =~ "ch_PP-OCRv3_det" ]]; then
  412. eval_model_name="ch_PP-OCRv3_det_infer"
  413. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  414. cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../
  415. fi
  416. if [[ ${model_name} =~ "ch_PP-OCRv2_rec" ]]; then
  417. eval_model_name="ch_PP-OCRv2_rec_infer"
  418. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  419. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_slim_quant_infer.tar --no-check-certificate
  420. cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_PP-OCRv2_rec_slim_quant_infer.tar && cd ../
  421. fi
  422. if [[ ${model_name} =~ "ch_PP-OCRv3_rec" ]]; then
  423. eval_model_name="ch_PP-OCRv3_rec_infer"
  424. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  425. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_slim_infer.tar --no-check-certificate
  426. cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_PP-OCRv3_rec_slim_infer.tar && cd ../
  427. fi
  428. if [[ ${model_name} == "ch_PP-OCRv3_rec_PACT" ]]; then
  429. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_slim_infer.tar --no-check-certificate
  430. cd ./inference && tar xf ch_PP-OCRv3_rec_slim_infer.tar && cd ../
  431. fi
  432. if [ ${model_name} == "en_server_pgnetA" ]; then
  433. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar --no-check-certificate
  434. cd ./inference && tar xf en_server_pgnetA.tar && tar xf ch_det_data_50.tar && cd ../
  435. fi
  436. if [ ${model_name} == "det_r50_vd_sast_icdar15_v2_0" ]; then
  437. 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
  438. cd ./inference/ && tar xf det_r50_vd_sast_icdar15_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
  439. fi
  440. if [ ${model_name} == "rec_mv3_none_none_ctc_v2_0" ]; then
  441. 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
  442. cd ./inference/ && tar xf rec_mv3_none_none_ctc_v2.0_train.tar && cd ../
  443. fi
  444. if [ ${model_name} == "rec_r34_vd_none_none_ctc_v2_0" ]; then
  445. 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
  446. cd ./inference/ && tar xf rec_r34_vd_none_none_ctc_v2.0_train.tar && cd ../
  447. fi
  448. if [ ${model_name} == "rec_mv3_none_bilstm_ctc_v2_0" ]; then
  449. 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
  450. cd ./inference/ && tar xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && cd ../
  451. fi
  452. if [ ${model_name} == "rec_r34_vd_none_bilstm_ctc_v2_0" ]; then
  453. 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
  454. cd ./inference/ && tar xf rec_r34_vd_none_bilstm_ctc_v2.0_train.tar && cd ../
  455. fi
  456. if [ ${model_name} == "rec_mv3_tps_bilstm_ctc_v2_0" ]; then
  457. 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
  458. cd ./inference/ && tar xf rec_mv3_tps_bilstm_ctc_v2.0_train.tar && cd ../
  459. fi
  460. if [ ${model_name} == "rec_r34_vd_tps_bilstm_ctc_v2_0" ]; then
  461. 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
  462. cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_ctc_v2.0_train.tar && cd ../
  463. fi
  464. if [ ${model_name} == "ch_ppocr_server_v2_0_rec" ]; then
  465. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_train.tar --no-check-certificate
  466. cd ./inference/ && tar xf ch_ppocr_server_v2.0_rec_train.tar && cd ../
  467. fi
  468. if [ ${model_name} == "ch_ppocr_mobile_v2_0_rec" ]; then
  469. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_train.tar --no-check-certificate
  470. cd ./inference/ && tar xf ch_ppocr_mobile_v2.0_rec_train.tar && cd ../
  471. fi
  472. if [ ${model_name} == "rec_mtb_nrtr" ]; then
  473. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_mtb_nrtr_train.tar --no-check-certificate
  474. cd ./inference/ && tar xf rec_mtb_nrtr_train.tar && cd ../
  475. fi
  476. if [ ${model_name} == "rec_mv3_tps_bilstm_att_v2_0" ]; then
  477. 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
  478. cd ./inference/ && tar xf rec_mv3_tps_bilstm_att_v2.0_train.tar && cd ../
  479. fi
  480. if [ ${model_name} == "rec_r34_vd_tps_bilstm_att_v2_0" ]; then
  481. 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
  482. cd ./inference/ && tar xf rec_r34_vd_tps_bilstm_att_v2.0_train.tar && cd ../
  483. fi
  484. if [ ${model_name} == "rec_r31_sar" ]; then
  485. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/rec/rec_r31_sar_train.tar --no-check-certificate
  486. cd ./inference/ && tar xf rec_r31_sar_train.tar && cd ../
  487. fi
  488. if [ ${model_name} == "rec_r50_fpn_vd_none_srn" ]; then
  489. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/rec_r50_vd_srn_train.tar --no-check-certificate
  490. cd ./inference/ && tar xf rec_r50_vd_srn_train.tar && cd ../
  491. fi
  492. if [ ${model_name} == "det_r50_vd_sast_totaltext_v2_0" ]; then
  493. 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
  494. cd ./inference/ && tar xf det_r50_vd_sast_totaltext_v2.0_train.tar && cd ../
  495. fi
  496. if [ ${model_name} == "det_mv3_db_v2_0" ]; then
  497. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar --no-check-certificate
  498. cd ./inference/ && tar xf det_mv3_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
  499. fi
  500. if [ ${model_name} == "det_r50_db_v2_0" ]; then
  501. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar --no-check-certificate
  502. cd ./inference/ && tar xf det_r50_vd_db_v2.0_train.tar && tar xf ch_det_data_50.tar && cd ../
  503. fi
  504. if [ ${model_name} == "det_mv3_pse_v2_0" ]; then
  505. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/det_mv3_pse_v2.0_train.tar --no-check-certificate
  506. cd ./inference/ && tar xf det_mv3_pse_v2.0_train.tar & cd ../
  507. fi
  508. if [ ${model_name} == "det_r50_vd_pse_v2_0" ]; then
  509. 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
  510. cd ./inference/ && tar xf det_r50_vd_pse_v2.0_train.tar & cd ../
  511. fi
  512. if [ ${model_name} == "det_mv3_east_v2_0" ]; then
  513. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_east_v2.0_train.tar --no-check-certificate
  514. cd ./inference/ && tar xf det_mv3_east_v2.0_train.tar & cd ../
  515. fi
  516. if [ ${model_name} == "det_r50_vd_east_v2_0" ]; then
  517. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_east_v2.0_train.tar --no-check-certificate
  518. cd ./inference/ && tar xf det_r50_vd_east_v2.0_train.tar & cd ../
  519. fi
  520. if [ ${model_name} == "det_r50_dcn_fce_ctw_v2_0" ]; then
  521. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/contribution/det_r50_dcn_fce_ctw_v2.0_train.tar --no-check-certificate
  522. cd ./inference/ && tar xf det_r50_dcn_fce_ctw_v2.0_train.tar & cd ../
  523. fi
  524. if [[ ${model_name} =~ "en_table_structure" ]];then
  525. 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
  526. 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
  527. cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar
  528. if [ ${model_name} == "en_table_structure" ]; then
  529. wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
  530. tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar
  531. elif [ ${model_name} == "en_table_structure_PACT" ]; then
  532. wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_slim_infer.tar --no-check-certificate
  533. tar xf en_ppocr_mobile_v2.0_table_structure_slim_infer.tar
  534. fi
  535. cd ../
  536. fi
  537. if [[ ${model_name} =~ "slanet" ]];then
  538. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_infer.tar --no-check-certificate
  539. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  540. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  541. 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 ../
  542. fi
  543. if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
  544. ${python_name} -m pip install -r ppstructure/kie/requirements.txt
  545. ${python_name} -m pip install opencv-python -U
  546. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_infer.tar --no-check-certificate
  547. cd ./inference/ && tar xf ser_vi_layoutxlm_xfund_infer.tar & cd ../
  548. fi
  549. if [[ ${model_name} =~ "layoutxlm_ser" ]]; then
  550. ${python_name} -m pip install -r ppstructure/kie/requirements.txt
  551. ${python_name} -m pip install opencv-python -U
  552. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh_infer.tar --no-check-certificate
  553. cd ./inference/ && tar xf ser_LayoutXLM_xfun_zh_infer.tar & cd ../
  554. fi
  555. fi
  556. if [[ ${model_name} =~ "KL" ]]; then
  557. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015_lite.tar --no-check-certificate
  558. cd ./train_data/ && tar xf icdar2015_lite.tar && rm -rf ./icdar2015 && ln -s ./icdar2015_lite ./icdar2015 && cd ../
  559. if [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
  560. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  561. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  562. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  563. fi
  564. if [ ${model_name} = "ch_PP-OCRv2_rec_KL" ]; then
  565. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  566. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  567. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  568. cd ./train_data/ && tar xf ic15_data.tar && cd ../
  569. cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
  570. fi
  571. if [ ${model_name} = "ch_PP-OCRv3_rec_KL" ]; then
  572. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  573. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  574. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  575. cd ./train_data/ && tar xf ic15_data.tar
  576. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_train_lite.txt --no-check-certificate
  577. wget -nc -P ./ic15_data/ https://paddleocr.bj.bcebos.com/dataset/rec_gt_test_lite.txt --no-check-certificate
  578. cd ../
  579. cd ./inference && tar xf rec_inference.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
  580. fi
  581. if [ ${model_name} = "ch_PP-OCRv2_det_KL" ]; then
  582. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  583. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  584. cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  585. fi
  586. if [ ${model_name} = "ch_PP-OCRv3_det_KL" ]; then
  587. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  588. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  589. cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  590. fi
  591. if [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
  592. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  593. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  594. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar --no-check-certificate
  595. cd ./train_data/ && tar xf ic15_data.tar && cd ../
  596. cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
  597. fi
  598. if [ ${model_name} = "en_table_structure_KL" ];then
  599. 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
  600. 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
  601. 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
  602. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/dataset/pubtabnet.tar --no-check-certificate
  603. 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 ../
  604. cd ./train_data/ && tar xf pubtabnet.tar && cd ../
  605. fi
  606. if [[ ${model_name} =~ "layoutxlm_ser_KL" ]]; then
  607. wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
  608. cd ./train_data/ && tar xf XFUND.tar && cd ../
  609. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh_infer.tar --no-check-certificate
  610. cd ./inference/ && tar xf ser_LayoutXLM_xfun_zh_infer.tar & cd ../
  611. fi
  612. fi
  613. if [ ${MODE} = "cpp_infer" ];then
  614. if [ ${model_name} = "ch_ppocr_mobile_v2_0_det" ]; then
  615. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  616. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  617. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  618. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_KL" ]; then
  619. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  620. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_klquant_infer.tar --no-check-certificate
  621. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
  622. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_det_PACT" ]; then
  623. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  624. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_pact_infer.tar --no-check-certificate
  625. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
  626. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec" ]; then
  627. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  628. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  629. cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
  630. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_KL" ]; then
  631. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  632. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_klquant_infer.tar --no-check-certificate
  633. cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
  634. elif [ ${model_name} = "ch_ppocr_mobile_v2_0_rec_PACT" ]; then
  635. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  636. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_pact_infer.tar --no-check-certificate
  637. cd ./inference && tar xf ch_ppocr_mobile_v2.0_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
  638. elif [ ${model_name} = "ch_ppocr_server_v2_0_det" ]; then
  639. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  640. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
  641. cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  642. elif [ ${model_name} = "ch_ppocr_server_v2_0_rec" ]; then
  643. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  644. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
  645. cd ./inference && tar xf ch_ppocr_server_v2.0_rec_infer.tar && tar xf rec_inference.tar && cd ../
  646. elif [ ${model_name} = "ch_PP-OCRv2_det" ]; then
  647. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  648. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  649. cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  650. elif [ ${model_name} = "ch_PP-OCRv2_det_KL" ]; then
  651. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  652. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_klquant_infer.tar --no-check-certificate
  653. cd ./inference && tar xf ch_PP-OCRv2_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
  654. elif [ ${model_name} = "ch_PP-OCRv2_det_PACT" ]; then
  655. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  656. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_pact_infer.tar --no-check-certificate
  657. cd ./inference && tar xf ch_PP-OCRv2_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
  658. elif [ ${model_name} = "ch_PP-OCRv2_rec" ]; then
  659. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  660. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  661. cd ./inference && tar xf ch_PP-OCRv2_rec_infer.tar && tar xf rec_inference.tar && cd ../
  662. elif [ ${model_name} = "ch_PP-OCRv2_rec_KL" ]; then
  663. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  664. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_klquant_infer.tar --no-check-certificate
  665. cd ./inference && tar xf ch_PP-OCRv2_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
  666. elif [ ${model_name} = "ch_PP-OCRv2_rec_PACT" ]; then
  667. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  668. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_pact_infer.tar --no-check-certificate
  669. cd ./inference && tar xf ch_PP-OCRv2_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
  670. elif [ ${model_name} = "ch_PP-OCRv3_det" ]; then
  671. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  672. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  673. cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_det_data_50.tar && cd ../
  674. elif [ ${model_name} = "ch_PP-OCRv3_det_KL" ]; then
  675. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  676. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_klquant_infer.tar --no-check-certificate
  677. cd ./inference && tar xf ch_PP-OCRv3_det_klquant_infer.tar && tar xf ch_det_data_50.tar && cd ../
  678. elif [ ${model_name} = "ch_PP-OCRv3_det_PACT" ]; then
  679. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  680. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_pact_infer.tar --no-check-certificate
  681. cd ./inference && tar xf ch_PP-OCRv3_det_pact_infer.tar && tar xf ch_det_data_50.tar && cd ../
  682. elif [ ${model_name} = "ch_PP-OCRv3_rec" ]; then
  683. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  684. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  685. cd ./inference && tar xf ch_PP-OCRv3_rec_infer.tar && tar xf rec_inference.tar && cd ../
  686. elif [ ${model_name} = "ch_PP-OCRv3_rec_KL" ]; then
  687. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  688. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_klquant_infer.tar --no-check-certificate
  689. cd ./inference && tar xf ch_PP-OCRv3_rec_klquant_infer.tar && tar xf rec_inference.tar && cd ../
  690. elif [ ${model_name} = "ch_PP-OCRv3_rec_PACT" ]; then
  691. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  692. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_pact_infer.tar --no-check-certificate
  693. cd ./inference && tar xf ch_PP-OCRv3_rec_pact_infer.tar && tar xf rec_inference.tar && cd ../
  694. elif [ ${model_name} = "ch_ppocr_mobile_v2_0" ]; then
  695. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  696. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  697. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  698. 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 ../
  699. elif [ ${model_name} = "ch_ppocr_server_v2_0" ]; then
  700. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
  701. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  702. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
  703. 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 ../
  704. elif [ ${model_name} = "ch_PP-OCRv2" ]; then
  705. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  706. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  707. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  708. 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 ../
  709. elif [ ${model_name} = "ch_PP-OCRv3" ]; then
  710. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  711. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  712. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  713. 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 ../
  714. elif [[ ${model_name} =~ "en_table_structure" ]];then
  715. 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
  716. 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
  717. cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar
  718. if [ ${model_name} == "en_table_structure" ]; then
  719. wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar --no-check-certificate
  720. tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar
  721. elif [ ${model_name} == "en_table_structure_PACT" ]; then
  722. wget -nc https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_slim_infer.tar --no-check-certificate
  723. tar xf en_ppocr_mobile_v2.0_table_structure_slim_infer.tar
  724. fi
  725. cd ../
  726. elif [[ ${model_name} =~ "slanet" ]];then
  727. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.tar --no-check-certificate
  728. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  729. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  730. 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 ../
  731. fi
  732. fi
  733. if [ ${MODE} = "serving_infer" ];then
  734. # prepare serving env
  735. python_name_list=$(func_parser_value "${lines[2]}")
  736. IFS='|'
  737. array=(${python_name_list})
  738. python_name=${array[0]}
  739. ${python_name} -m pip install paddle-serving-server-gpu
  740. ${python_name} -m pip install paddle_serving_client
  741. ${python_name} -m pip install paddle-serving-app
  742. ${python_name} -m pip install https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl
  743. # wget model
  744. if [ ${model_name} == "ch_ppocr_mobile_v2_0_det_KL" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_KL" ] ; then
  745. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_klquant_infer.tar --no-check-certificate
  746. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_klquant_infer.tar --no-check-certificate
  747. 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 ../
  748. elif [ ${model_name} == "ch_PP-OCRv2_det_KL" ] || [ ${model_name} == "ch_PP-OCRv2_rec_KL" ] ; then
  749. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_klquant_infer.tar --no-check-certificate
  750. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_klquant_infer.tar --no-check-certificate
  751. cd ./inference && tar xf ch_PP-OCRv2_det_klquant_infer.tar && tar xf ch_PP-OCRv2_rec_klquant_infer.tar && cd ../
  752. elif [ ${model_name} == "ch_PP-OCRv3_det_KL" ] || [ ${model_name} == "ch_PP-OCRv3_rec_KL" ] ; then
  753. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_klquant_infer.tar --no-check-certificate
  754. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_klquant_infer.tar --no-check-certificate
  755. cd ./inference && tar xf ch_PP-OCRv3_det_klquant_infer.tar && tar xf ch_PP-OCRv3_rec_klquant_infer.tar && cd ../
  756. elif [ ${model_name} == "ch_ppocr_mobile_v2_0_det_PACT" ] || [ ${model_name} == "ch_ppocr_mobile_v2.0_rec_PACT" ] ; then
  757. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_det_pact_infer.tar --no-check-certificate
  758. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_ppocr_mobile_v2.0_rec_pact_infer.tar --no-check-certificate
  759. 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 ../
  760. elif [ ${model_name} == "ch_PP-OCRv2_det_PACT" ] || [ ${model_name} == "ch_PP-OCRv2_rec_PACT" ] ; then
  761. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_det_pact_infer.tar --no-check-certificate
  762. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv2_rec_pact_infer.tar --no-check-certificate
  763. cd ./inference && tar xf ch_PP-OCRv2_det_pact_infer.tar && tar xf ch_PP-OCRv2_rec_pact_infer.tar && cd ../
  764. elif [ ${model_name} == "ch_PP-OCRv3_det_PACT" ] || [ ${model_name} == "ch_PP-OCRv3_rec_PACT" ] ; then
  765. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_det_pact_infer.tar --no-check-certificate
  766. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/tipc_fake_model/ch_PP-OCRv3_rec_pact_infer.tar --no-check-certificate
  767. cd ./inference && tar xf ch_PP-OCRv3_det_pact_infer.tar && tar xf ch_PP-OCRv3_rec_pact_infer.tar && cd ../
  768. elif [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
  769. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  770. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  771. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && cd ../
  772. elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
  773. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
  774. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
  775. cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && cd ../
  776. elif [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
  777. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  778. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  779. cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
  780. elif [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
  781. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  782. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  783. cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
  784. fi
  785. # wget data
  786. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate
  787. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar --no-check-certificate
  788. cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
  789. fi
  790. if [ ${MODE} = "paddle2onnx_infer" ];then
  791. # prepare serving env
  792. python_name=$(func_parser_value "${lines[2]}")
  793. ${python_name} -m pip install paddle2onnx onnxruntime onnx
  794. # wget model
  795. if [[ ${model_name} =~ "ch_ppocr_mobile_v2_0" ]]; then
  796. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate
  797. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar --no-check-certificate
  798. cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && cd ../
  799. elif [[ ${model_name} =~ "ch_ppocr_server_v2_0" ]]; then
  800. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar --no-check-certificate
  801. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar --no-check-certificate
  802. cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && cd ../
  803. elif [[ ${model_name} =~ "ch_PP-OCRv2" ]]; then
  804. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar --no-check-certificate
  805. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar --no-check-certificate
  806. cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && tar xf ch_PP-OCRv2_rec_infer.tar && cd ../
  807. elif [[ ${model_name} =~ "ch_PP-OCRv3" ]]; then
  808. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
  809. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
  810. cd ./inference && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
  811. elif [[ ${model_name} =~ "slanet" ]];then
  812. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.tar --no-check-certificate
  813. cd ./inference/ && tar xf ch_ppstructure_mobile_v2.0_SLANet_infer.tar && cd ../
  814. elif [[ ${model_name} =~ "en_table_structure" ]];then
  815. 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
  816. cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_structure_infer.tar && cd ../
  817. fi
  818. # wget data
  819. wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
  820. wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar
  821. cd ./inference && tar xf ch_det_data_50.tar && tar xf rec_inference.tar && cd ../
  822. fi