首页 > 其他分享 >VideoPipe可视化视频结构化框架新增功能详解(2022-11-4)

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

时间:2022-11-04 15:48:23浏览次数:87  
标签:11 src 2022 .. vp file nodes VideoPipe

VideoPipe从国庆节上线源代码到现在经历过了一个月时间,期间吸引了若干小伙伴的参与,现将本阶段新增内容总结如下,有兴趣的朋友可以加微信拉群交流。

项目地址:https://github.com/sherlockchou86/video_pipe_c

以往文章:https://www.cnblogs.com/xiaozhi_5638/p/16767917.html

跟踪插件

新增了跟踪插件,同时实现了默认的SORT目标跟踪算法,后期扩展Deep SORT算法非常方便。下面是车辆跟踪的效果(底部是pipe运行状态图):

下面是人脸跟踪的效果:

 

录像和截图插件

新增了录像截图插件,同时提供了一个人工模拟录像或截图的接口供测试。当用户向管道中发送录像、截图控制指令时,录像截图插件就开始异步工作。下面是异步录像原理:

 

日志库

新增了一个轻量级的日志库,支持多线程异步日志写入、支持日志文件自动拆分。日志没使用第三方库,下面是日志使用方法和效果:

 1 // log level
 2 VP_SET_LOG_LEVEL(_log_level);
 3 // log file dir
 4 VP_SET_LOG_DIR(_log_dir);
 5 
 6 // log to console or not
 7 VP_SET_LOG_TO_CONSOLE(_log_to_console);
 8 // log to file or not
 9 VP_SET_LOG_TO_FILE(_log_to_file);
10 // TO-DO
11 VP_SET_LOG_TO_KAFKA(_log_to_kafka);
12 
13 // include log level or not
14 VP_SET_LOG_INCLUDE_LEVEL(_include_level);
15 // include code location or not (where the log occurs)
16 VP_SET_LOG_INCLUDE_CODE_LOCATION(_include_code_location);
17 // include thread id or not (std::this_thread::get_id())
18 VP_SET_LOG_INCLUDE_THREAD_ID(_include_thread_id);
19 
20 // warn if log cache in memory exceed this value
21 VP_SET_LOG_CACHE_WARN_THRES(_log_cache_warn_threshold);
 1 [2022-11-04 14:12:47.218][Info ] [file_src_0] reading frame complete, total frame==>354
 2 [2022-11-04 14:12:47.219][Info ] [file_src_0] cycle flag is true, continue!
 3 [2022-11-04 14:15:23.416][Warn ][7ffff7f81000][../nodes/vp_infer_node.cpp:39] [vehicle_detector] cv::dnn::readNet load network failed!
 4 [2022-11-04 14:15:24.227][Info ][7ffff7f81000][../nodes/vp_screen_des_node.cpp:14] [screen_des_0] [appsrc ! videoconvert ! textoverlay text=screen_des_0 halignment=left valignment=top font-desc='Sans,16' shaded-background=true ! timeoverlay halignment=right valignment=top font-desc='Sans,16' shaded-background=true ! queue ! fpsdisplaysink video-sink=ximagesink sync=false]
 5 [2022-11-04 14:15:24.227][Info ][7ffff7f81000][../utils/analysis_board/../vp_pipe_checker.h:167] 
 6 ############# pipe check summary ##############
 7  total layers: 5
 8  layer index,       node names
 9  1                    file_src_0,
10  2                    vehicle_detector,
11  3                    track_0,
12  4                    osd_0,
13  5                    screen_des_0,
14 ############# pipe check summary ##############
15 
16 [2022-11-04 14:16:04.638][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:66] [file_src_0] reading frame complete, total frame==>999
17 [2022-11-04 14:16:04.639][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:68] [file_src_0] cycle flag is true, continue!
18 [2022-11-04 14:16:45.258][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:66] [file_src_0] reading frame complete, total frame==>1999
19 [2022-11-04 14:16:45.259][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:68] [file_src_0] cycle flag is true, continue!
20 [2022-11-04 14:17:25.838][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:66] [file_src_0] reading frame complete, total frame==>2999
21 [2022-11-04 14:17:25.839][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:68] [file_src_0] cycle flag is true, continue!
22 [2022-11-04 14:18:06.498][Info ][7fff47318700][../nodes/vp_file_src_node.cpp:66] [file_src_0] reading frame complete, total frame==>3999

 

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"
 9 
10 #include "../utils/analysis_board/vp_analysis_board.h"
11 
12 /*
13 * ## 1-1-1 sample ##
14 * 1 video input, 1 infer task, and 1 output.
15 */
16 
17 #if _1_1_1_sample
18 
19 int main() {
20     VP_SET_LOG_INCLUDE_CODE_LOCATION(false);
21     VP_SET_LOG_INCLUDE_THREAD_ID(false);
22     VP_LOGGER_INIT();
23 
24     // create nodes
25     auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, "./test_video/10.mp4", 0.6);
26     auto 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");
27     auto 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");
28     auto osd_0 = std::make_shared<vp_nodes::vp_face_osd_node_v2>("osd_0");
29     auto screen_des_0 = std::make_shared<vp_nodes::vp_screen_des_node>("screen_des_0", 0);
30 
31     // construct pipeline
32     yunet_face_detector_0->attach_to({file_src_0});
33     sface_face_encoder_0->attach_to({yunet_face_detector_0});
34     osd_0->attach_to({sface_face_encoder_0});
35     screen_des_0->attach_to({osd_0});
36 
37     file_src_0->start();
38 
39     // for debug purpose
40     vp_utils::vp_analysis_board board({file_src_0});
41     board.display();
42 }
43 
44 #endif

上面代码生成的pipe如下图所示:

感兴趣的朋友加微信交流,框架非常适合新手入门!

标签:11,src,2022,..,vp,file,nodes,VideoPipe
From: https://www.cnblogs.com/xiaozhi_5638/p/16857995.html

相关文章

  • 20221102 SMO1 HW
    YeahmaybeonetopicTemasimulationsthistopicwehaveontheagenda.IthinkthatthesmallestalsocrossovertoMDbecauseonoursideitalsositemainly......
  • #yyds干货盘点#【愚公系列】2022年11月 微信小程序-icon图标详解
    前言在小程序中经常会用到各种各样的图标,如果这些图标都使用图片的话,将会大大增加小程序打包后的体积,而小程序限制代码最大2MB,分包加载4MB,所以为了缩小体积,我们可以使用图......
  • P1103 书本整理 (DP)
    书本整理题目描述Frank是一个非常喜爱整洁的人。他有一大堆书和一个书架,想要把书放在书架上。书架可以放下所有的书,所以Frank首先将书按高度顺序排列在书架上。但是Frank......
  • 一个29+前端2022年年中总结(负债,当爹,找工作)
    作为一个29岁的前端,2022年对我来说总的还是一句话:不管生活多糟糕,日子还是得过的。买房计划自从经历过房东让连夜搬家的事情后,买房的打算就提上日程了。我和老婆两个也算行动......
  • 东进云服务器密码机荣获“2022中国网络安全行业最具竞争力产品”奖
    11月3日,由赛迪网、《数字经济》杂志联合主办的2022(第五届)行业信息化技术创新发展峰会在北京成功举办。大会现场重磅发布《2022行业信息化竞争力百强-2022行业信息化推优成......
  • 2022UUCTF新生赛wp by S1gMa
    2022UUCTF新生赛wpbyS1gMa前言\(misc\)本以为\(ak\)了,结果比赛结束前又来一道阴间社工,所以直接无视就当\(ak\)了~Whereisflag?知识点1.文件分离;2.\(PNG\)......
  • CSP-S2022 vp 小记
    一些闲话初赛出的什么玩意,真的逆天,我能不能用宇宙射线照照出题人的脑子呢?我也很逆天,甚至连\(90\)分都没上,怎么回事呢?FJcsp和noip可能没有Linux用,教练让我们......
  • Java学习——11.04
    因为昨天学的有点少,上不了台面,所以和今天的一起写,当然还可能是自己太懒了,昨天的没记住,于是又看了一遍。1.变量:局部变量(和C一样的)实例变量(加new引用文件名创建函数......
  • ISCTF2022WP
    ISCTF2022改名叫套CTF吧(bushi),博主菜鸡一个,套题太多,挑一些题写下wp,勿喷。MISC可爱的emoji  下载下来是个加密压缩包,根据hint掩码爆破密码   得到密码:KEYISAES......
  • 2022-11-04 js foreach 三重循环
    letarr=[];req.data.forEach((e,k1)=>{letobj={};obj.value=e.content;obj.children=[];obj.expand=false;if(e.children){e.child......