提交 45d4afec 编写于 作者: M MissPenguin

refine

上级 efb1b412
......@@ -50,6 +50,7 @@ inference:tools/infer/predict_det.py
--benchmark:True
null:null
===========================cpp_infer_params===========================
use_opencv:True
infer_model:./inference/ch_ppocr_mobile_v2.0_det_infer/
infer_quant:False
inference:./deploy/cpp_infer/build/ppocr det
......
......@@ -75,49 +75,56 @@ elif [ ${MODE} = "infer" ] || [ ${MODE} = "cpp_infer" ];then
fi
if [ ${MODE} = "cpp_infer" ];then
echo "################### build opencv ###################"
cd deploy/cpp_infer
rm -rf 3.4.7.tar.gz opencv-3.4.7/
wget https://github.com/opencv/opencv/archive/3.4.7.tar.gz
tar -xf 3.4.7.tar.gz
use_opencv=$(func_parser_value "${lines[52]}")
if [ ${use_opencv} = "True" ]; then
echo "################### build opencv ###################"
rm -rf 3.4.7.tar.gz opencv-3.4.7/
wget https://github.com/opencv/opencv/archive/3.4.7.tar.gz
tar -xf 3.4.7.tar.gz
cd opencv-3.4.7/
install_path=$(pwd)/opencv-3.4.7/opencv3
cd opencv-3.4.7/
install_path=$(pwd)/opencv-3.4.7/opencv3
rm -rf build
mkdir build
cd build
rm -rf build
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=${install_path} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_IPP=OFF \
-DBUILD_IPP_IW=OFF \
-DWITH_LAPACK=OFF \
-DWITH_EIGEN=OFF \
-DCMAKE_INSTALL_LIBDIR=lib64 \
-DWITH_ZLIB=ON \
-DBUILD_ZLIB=ON \
-DWITH_JPEG=ON \
-DBUILD_JPEG=ON \
-DWITH_PNG=ON \
-DBUILD_PNG=ON \
-DWITH_TIFF=ON \
-DBUILD_TIFF=ON
cmake .. \
-DCMAKE_INSTALL_PREFIX=${install_path} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_IPP=OFF \
-DBUILD_IPP_IW=OFF \
-DWITH_LAPACK=OFF \
-DWITH_EIGEN=OFF \
-DCMAKE_INSTALL_LIBDIR=lib64 \
-DWITH_ZLIB=ON \
-DBUILD_ZLIB=ON \
-DWITH_JPEG=ON \
-DBUILD_JPEG=ON \
-DWITH_PNG=ON \
-DBUILD_PNG=ON \
-DWITH_TIFF=ON \
-DBUILD_TIFF=ON
make -j
make install
cd ../
echo "################### build opencv finished ###################"
make -j
make install
cd ../
echo "################### build opencv finished ###################"
fi
echo "################### build PaddleOCR demo ####################"
OPENCV_DIR=$(pwd)/opencv-3.4.7/opencv3/
if [ ${use_opencv} = "True" ]; then
OPENCV_DIR=$(pwd)/opencv-3.4.7/opencv3/
else
OPENCV_DIR=''
fi
LIB_DIR=$(pwd)/Paddle/build/paddle_inference_install_dir/
CUDA_LIB_DIR=/usr/local/cuda/lib64/
CUDNN_LIB_DIR=/usr/lib/x86_64-linux-gnu/
CUDA_LIB_DIR=$(dirname `find /usr -name libcudart.so`)
CUDNN_LIB_DIR=$(dirname `find /usr -name libcudnn.so`)
BUILD_DIR=build
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
......
......@@ -147,28 +147,28 @@ infer_value1=$(func_parser_value "${lines[50]}")
if [ ${MODE} = "cpp_infer" ]; then
# parser cpp inference model
cpp_infer_model_dir_list=$(func_parser_value "${lines[52]}")
cpp_infer_is_quant=$(func_parser_value "${lines[53]}")
cpp_infer_model_dir_list=$(func_parser_value "${lines[53]}")
cpp_infer_is_quant=$(func_parser_value "${lines[54]}")
# parser cpp inference
inference_cmd=$(func_parser_value "${lines[54]}")
cpp_use_gpu_key=$(func_parser_key "${lines[55]}")
cpp_use_gpu_list=$(func_parser_value "${lines[55]}")
cpp_use_mkldnn_key=$(func_parser_key "${lines[56]}")
cpp_use_mkldnn_list=$(func_parser_value "${lines[56]}")
cpp_cpu_threads_key=$(func_parser_key "${lines[57]}")
cpp_cpu_threads_list=$(func_parser_value "${lines[57]}")
cpp_batch_size_key=$(func_parser_key "${lines[58]}")
cpp_batch_size_list=$(func_parser_value "${lines[58]}")
cpp_use_trt_key=$(func_parser_key "${lines[59]}")
cpp_use_trt_list=$(func_parser_value "${lines[59]}")
cpp_precision_key=$(func_parser_key "${lines[60]}")
cpp_precision_list=$(func_parser_value "${lines[60]}")
cpp_infer_model_key=$(func_parser_key "${lines[61]}")
cpp_image_dir_key=$(func_parser_key "${lines[62]}")
cpp_infer_img_dir=$(func_parser_value "${lines[62]}")
cpp_save_log_key=$(func_parser_key "${lines[63]}")
cpp_benchmark_key=$(func_parser_key "${lines[64]}")
cpp_benchmark_value=$(func_parser_value "${lines[64]}")
inference_cmd=$(func_parser_value "${lines[55]}")
cpp_use_gpu_key=$(func_parser_key "${lines[56]}")
cpp_use_gpu_list=$(func_parser_value "${lines[56]}")
cpp_use_mkldnn_key=$(func_parser_key "${lines[57]}")
cpp_use_mkldnn_list=$(func_parser_value "${lines[57]}")
cpp_cpu_threads_key=$(func_parser_key "${lines[58]}")
cpp_cpu_threads_list=$(func_parser_value "${lines[58]}")
cpp_batch_size_key=$(func_parser_key "${lines[59]}")
cpp_batch_size_list=$(func_parser_value "${lines[59]}")
cpp_use_trt_key=$(func_parser_key "${lines[60]}")
cpp_use_trt_list=$(func_parser_value "${lines[60]}")
cpp_precision_key=$(func_parser_key "${lines[61]}")
cpp_precision_list=$(func_parser_value "${lines[61]}")
cpp_infer_model_key=$(func_parser_key "${lines[62]}")
cpp_image_dir_key=$(func_parser_key "${lines[63]}")
cpp_infer_img_dir=$(func_parser_value "${lines[63]}")
cpp_save_log_key=$(func_parser_key "${lines[64]}")
cpp_benchmark_key=$(func_parser_key "${lines[65]}")
cpp_benchmark_value=$(func_parser_value "${lines[65]}")
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册