Files
VideoPipe/nodes/infers/vp_enet_seg_node.cpp
2026-06-03 12:43:14 +08:00

33 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "vp_enet_seg_node.h"
namespace vp_nodes {
vp_enet_seg_node::vp_enet_seg_node(std::string node_name,
std::string model_path,
std::string model_config_path,
std::string labels_path,
int input_width,
int input_height,
int batch_size,
int class_id_offset,
float scale,
cv::Scalar mean,
cv::Scalar std,
bool swap_rb):
vp_primary_infer_node(node_name, model_path, model_config_path, labels_path, input_width, input_height, batch_size, class_id_offset, scale, mean, std, swap_rb) {
this->initialized();
}
vp_enet_seg_node::~vp_enet_seg_node() {
deinitialized();
}
void vp_enet_seg_node::postprocess(const std::vector<cv::Mat>& raw_outputs, const std::vector<std::shared_ptr<vp_objects::vp_frame_meta>>& frame_meta_with_batch) {
auto& frame_meta = frame_meta_with_batch[0];
auto& mask = raw_outputs[0];
// save output as mask directly this is the mask for the whole frame.
frame_meta->mask = mask.clone();
}
}