46 lines
1.8 KiB
C++
46 lines
1.8 KiB
C++
#include "../nodes/vp_file_src_node.h"
|
|
#include "../nodes/infers/vp_yunet_face_detector_node.h"
|
|
#include "../nodes/infers/vp_sface_feature_encoder_node.h"
|
|
#include "../nodes/osd/vp_face_osd_node_v2.h"
|
|
#include "../nodes/vp_screen_des_node.h"
|
|
#include "../nodes/vp_rtmp_des_node.h"
|
|
|
|
#include "../utils/analysis_board/vp_analysis_board.h"
|
|
|
|
/*
|
|
* ## 1-1-N sample ##
|
|
* 1 video input, 1 infer task, and 2 outputs.
|
|
*/
|
|
|
|
int main() {
|
|
VP_SET_LOG_INCLUDE_CODE_LOCATION(false);
|
|
VP_SET_LOG_INCLUDE_THREAD_ID(false);
|
|
VP_LOGGER_INIT();
|
|
|
|
// create nodes
|
|
auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, "./vp_data/test_video/face.mp4", 0.8);
|
|
auto yunet_face_detector_0 = std::make_shared<vp_nodes::vp_yunet_face_detector_node>("yunet_face_detector_0", "./vp_data/models/face/face_detection_yunet_2022mar.onnx");
|
|
auto sface_face_encoder_0 = std::make_shared<vp_nodes::vp_sface_feature_encoder_node>("sface_face_encoder_0", "./vp_data/models/face/face_recognition_sface_2021dec.onnx");
|
|
auto osd_0 = std::make_shared<vp_nodes::vp_face_osd_node_v2>("osd_0");
|
|
auto screen_des_0 = std::make_shared<vp_nodes::vp_screen_des_node>("screen_des_0", 0);
|
|
auto rtmp_des_0 = std::make_shared<vp_nodes::vp_rtmp_des_node>("rtmp_des_0", 0, "rtmp://192.168.77.60/live/10000");
|
|
|
|
// construct pipeline
|
|
yunet_face_detector_0->attach_to({file_src_0});
|
|
sface_face_encoder_0->attach_to({yunet_face_detector_0});
|
|
osd_0->attach_to({sface_face_encoder_0});
|
|
|
|
// auto split
|
|
screen_des_0->attach_to({osd_0});
|
|
rtmp_des_0->attach_to({osd_0});
|
|
|
|
file_src_0->start();
|
|
|
|
// for debug purpose
|
|
vp_utils::vp_analysis_board board({file_src_0});
|
|
board.display(1, false);
|
|
|
|
std::string wait;
|
|
std::getline(std::cin, wait);
|
|
file_src_0->detach_recursively();
|
|
} |