prepare.sh 65 KB

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