ConstructProtobuf

Function Usage

This function can be used to convert the data structure used for model postprocessing into the protobuf data structure and write metadata for communication between plugins. Select an overloaded function based on the input parameter data type.

Prototype

std::shared_ptr<MxTools::MxpiObjectList> ConstructProtobuf(
    const std::vector<std::vector<MxBase::ObjectInfo>> &objectInfos, std::string dataSource);
std::shared_ptr<MxTools::MxpiClassList> ConstructProtobuf(
    const std::vector<std::vector<MxBase::ClassInfo>>& classInfos,std::string dataSource);
std::shared_ptr<MxTools::MxpiImageMaskList> ConstructProtobuf(
    const std::vector<MxBase::SemanticSegInfo> &semanticSegInfos, std::string dataSource);
std::shared_ptr<MxTools::MxpiTextsInfoList> ConstructProtobuf(
    const std::vector<MxBase::TextsInfo>& textsInfo, std::string dataSource);
std::shared_ptr<MxTools::MxpiTextObjectList> ConstructProtobuf(
    const std::vector<std::vector<MxBase::TextObjectInfo>>& textObjectInfos, std::string dataSource);
std::shared_ptr<MxTools::MxpiPoseList> ConstructProtobuf(
    const std::vector<std::vector<MxBase::KeyPointDetectionInfo>>& keyPointInfos, std::string dataSource);

Parameter Description

Parameter

Description

objectInfos

Object detection result

classInfos

Classification result

semanticSegInfos

Semantic segmentation result

textsInfo

Text generation result

textObjectInfos

Text box detection result

keyPointInfos

Key point detection result

dataSource

Name of the upstream plugin

Return Parameter Description

Data Structure

Description

std::shared_ptr<MxTools::MxpiObjectList>

Smart pointer of protobuf corresponding to the input parameter type

std::shared_ptr<MxTools::MxpiClassList>

std::shared_ptr<MxTools::MxpiImageMaskList>

std::shared_ptr<MxTools::MxpiTextsInfoList>

std::shared_ptr<MxTools::MxpiTextObjectList>