#include "../../nodes/vp_file_src_node.h"
|
#include "../../nodes/infers/vp_trt_vehicle_plate_detector_v2.h"
|
#include "../../nodes/track/vp_sort_track_node.h"
|
#include "../../nodes/broker/vp_plate_socket_broker_node.h"
|
#include "../../nodes/osd/vp_plate_osd_node.h"
|
#include "../../nodes/vp_screen_des_node.h"
|
#include "../../nodes/vp_rtmp_des_node.h"
|
#include "../../utils/analysis_board/vp_analysis_board.h"
|
|
/*
|
* ## license plate recognize(lpr) pipeline ##
|
* detect and recognize license plate in the whole frame, and send results via socket.
|
*/
|
|
int main(int argc, char* argv[]) {
|
// get directory for test video and models
|
assert(argc == 2);
|
std::string data_dir(argv[1]);
|
if (!vp_utils::ends_with(data_dir, "/")) {
|
data_dir += "/";
|
}
|
|
VP_SET_LOG_LEVEL(vp_utils::vp_log_level::INFO);
|
VP_LOGGER_INIT();
|
|
// create nodes
|
auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, data_dir + "vp_data/test_video/plate2.mp4");
|
auto plate_detector = std::make_shared<vp_nodes::vp_trt_vehicle_plate_detector_v2>("plate_detector", data_dir + "vp_data/models/trt/plate/det_v8.5.trt", data_dir + "vp_data/models/trt/plate/rec_v8.5.trt");
|
auto track = std::make_shared<vp_nodes::vp_sort_track_node>("tracker");
|
auto plate_broker = std::make_shared<vp_nodes::vp_plate_socket_broker_node>("plate_broker", "192.168.77.68", 9999, "static/plate_images");
|
auto osd_0 = std::make_shared<vp_nodes::vp_plate_osd_node>("osd_0", data_dir + "vp_data/font/NotoSansCJKsc-Medium.otf", false);
|
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/lpr");
|
|
// construct pipeline
|
plate_detector->attach_to({file_src_0});
|
track->attach_to({plate_detector});
|
plate_broker->attach_to({track});
|
osd_0->attach_to({plate_broker});
|
screen_des_0->attach_to({osd_0});
|
rtmp_des_0->attach_to({osd_0});
|
|
// start pipeline
|
file_src_0->start();
|
|
// visualize pipeline for debug
|
vp_utils::vp_analysis_board board({file_src_0});
|
board.display();
|
}
|