xxr 513500cb00 | 1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
compile.sh | 1 year ago | |
run.sh | 1 year ago | |
yolov3_test.cc | 1 year ago |
下载paddle_inference预测库并解压存储到Paddle-Inference-Demo/c++/lib
目录,lib目录结构如下所示
Paddle-Inference-Demo/c++/lib/
├── CMakeLists.txt
└── paddle_inference
├── CMakeCache.txt
├── paddle
│ ├── include C++ 预测库头文件目录
│ │ ├── crypto
│ │ ├── internal
│ │ ├── paddle_analysis_config.h
│ │ ├── paddle_api.h
│ │ ├── paddle_infer_declare.h
│ │ ├── paddle_inference_api.h C++ 预测库头文件
│ │ ├── paddle_mkldnn_quantizer_config.h
│ │ └── paddle_pass_builder.h
│ └── lib
│ ├── libpaddle_inference.a C++ 静态预测库文件
│ └── libpaddle_inference.so C++ 动态态预测库文件
├── third_party
│ ├── install 第三方链接库和头文件
│ │ ├── cryptopp
│ │ ├── gflags
│ │ ├── glog
│ │ ├── mkldnn
│ │ ├── mklml
│ │ ├── protobuf
│ │ └── xxhash
│ └── threadpool
│ └── ThreadPool.h
└── version.txt
点击链接下载模型,如果你想获取更多的模型训练信息,请访问这里。
wget https://paddle-inference-dist.bj.bcebos.com/Paddle-Inference-Demo/yolov3_r50vd_dcn_270e_coco.tgz
tar xzf yolov3_r50vd_dcn_270e_coco.tgz
文件yolov3_test.cc
为预测的样例程序(程序中的输入为固定值,如果您有opencv或其他方式进行数据读取的需求,需要对程序进行一定的修改)。
脚本compile.sh
包含了第三方库、预编译库的信息配置。
脚本run.sh
为一键运行脚本。
编译yolov3样例,我们首先需要对脚本compile.sh
文件中的配置进行修改。
1)修改compile.sh
打开compile.sh
,我们对以下的几处信息进行修改:
# 根据预编译库中的version.txt信息判断是否将以下三个标记打开
WITH_MKL=ON
WITH_GPU=ON
USE_TENSORRT=OFF
# 配置预测库的根目录
LIB_DIR=${work_path}/../lib/paddle_inference
# 如果上述的WITH_GPU 或 USE_TENSORRT设为ON,请设置对应的CUDA, CUDNN, TENSORRT的路径。
CUDNN_LIB=/usr/lib/x86_64-linux-gnu/
CUDA_LIB=/usr/local/cuda/lib64
TENSORRT_ROOT=/usr/local/TensorRT-6.0.1.5
运行 bash compile.sh
, 会在目录下产生build目录。
2) 运行样例
bash run.sh
# 或者
bash compile.sh
./build/yolov3_test -model_file yolov3_r50vd_dcn_270e_coco/model.pdmodel --params_file yolov3_r50vd_dcn_270e_coco/model.pdiparams
运行结束后,程序会将模型输出个数打印到屏幕,说明运行成功。
使用paddledetection在jetson nano上部署目标检测网络,检测简单手势,然后再通过nano控制beep等外设,来达到beep的变频输出
Markdown C++ Python reStructuredText Shell other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》