2022-11-4 VideoPipe可视化视频结构化框架新增功能详解( 二 )

sample代码新增加13个sample文件 , 可以独立运行 , 涵盖pipe结构、各种插件使用举例 。下面是1-1-1 sample代码和效果:
1 #include "VP.h" 2 3 #include "../nodes/vp_file_src_node.h" 4 #include "../nodes/infers/vp_yunet_face_detector_node.h" 5 #include "../nodes/infers/vp_sface_feature_encoder_node.h" 6 #include "../nodes/osd/vp_face_osd_node_v2.h" 7 #include "../nodes/vp_screen_des_node.h" 8 #include "../nodes/vp_rtmp_des_node.h" 910 #include "../utils/analysis_board/vp_analysis_board.h"1112 /*13 * ## 1-1-1 sample ##14 * 1 video input, 1 infer task, and 1 output.15 */1617 #if _1_1_1_sample1819 int main() {20VP_SET_LOG_INCLUDE_CODE_LOCATION(false);21VP_SET_LOG_INCLUDE_THREAD_ID(false);22VP_LOGGER_INIT();2324// create nodes25auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, "./test_video/10.mp4", 0.6);26auto yunet_face_detector_0 = std::make_shared<vp_nodes::vp_yunet_face_detector_node>("yunet_face_detector_0", "./models/face/face_detection_yunet_2022mar.onnx");27auto sface_face_encoder_0 = std::make_shared<vp_nodes::vp_sface_feature_encoder_node>("sface_face_encoder_0", "./models/face/face_recognition_sface_2021dec.onnx");28auto osd_0 = std::make_shared<vp_nodes::vp_face_osd_node_v2>("osd_0");29auto screen_des_0 = std::make_shared<vp_nodes::vp_screen_des_node>("screen_des_0", 0);3031// construct pipeline32yunet_face_detector_0->attach_to({file_src_0});33sface_face_encoder_0->attach_to({yunet_face_detector_0});34osd_0->attach_to({sface_face_encoder_0});35screen_des_0->attach_to({osd_0});3637file_src_0->start();3839// for debug purpose40vp_utils::vp_analysis_board board({file_src_0});41board.display();42 }4344 #endif上面代码生成的pipe如下图所示:

2022-11-4 VideoPipe可视化视频结构化框架新增功能详解

文章插图
感兴趣的朋友加微信交流 , 框架非常适合新手入门!
【2022-11-4 VideoPipe可视化视频结构化框架新增功能详解】

经验总结扩展阅读