Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
dai::node::DetectionParser Class Reference

DetectionParser node. Parses detection results from different neural networks and is being used internally by MobileNetDetectionNetwork and YoloDetectionNetwork. More...

#include <DetectionParser.hpp>

Inheritance diagram for dai::node::DetectionParser:
Inheritance graph
[legend]

Public Member Functions

 DetectionParser (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
 
 DetectionParser (const std::shared_ptr< PipelineImpl > &par, int64_t nodeId, std::unique_ptr< Properties > props)
 
std::map< std::string, std::vector< int > > getAnchorMasks () const
 Get anchor masks. More...
 
std::vector< float > getAnchors () const
 Get anchors. More...
 
float getConfidenceThreshold () const
 
int getCoordinateSize () const
 Get coordianate size. More...
 
float getIouThreshold () const
 Get Iou threshold. More...
 
DetectionNetworkType getNNFamily ()
 
int getNumClasses () const
 Get num classes. More...
 
int getNumFramesPool ()
 
void setAnchorMasks (std::map< std::string, std::vector< int >> anchorMasks)
 Set anchor masks. More...
 
void setAnchors (std::vector< float > anchors)
 Set anchors. More...
 
void setBlob (const OpenVINO::Blob &blob)
 
void setConfidenceThreshold (float thresh)
 
void setCoordinateSize (int coordinates)
 Set coordianate size. More...
 
void setIouThreshold (float thresh)
 Set Iou threshold. More...
 
void setNNFamily (DetectionNetworkType type)
 
void setNumClasses (int numClasses)
 Set num classes. More...
 
void setNumFramesPool (int numFramesPool)
 
- Public Member Functions inherited from dai::NodeCRTP< Node, DetectionParser, DetectionParserProperties >
std::unique_ptr< Nodeclone () const override
 
const char * getName () const override
 
- Public Member Functions inherited from dai::Node
virtual std::unique_ptr< Nodeclone () const =0
 Deep copy the node. More...
 
AssetManagergetAssetManager ()
 Get node AssetManager as a reference. More...
 
const AssetManagergetAssetManager () const
 Get node AssetManager as a const reference. More...
 
std::vector< Input * > getInputRefs ()
 Retrieves reference to node inputs. More...
 
std::vector< const Input * > getInputRefs () const
 Retrieves reference to node inputs. More...
 
std::vector< InputgetInputs ()
 Retrieves all nodes inputs. More...
 
virtual const char * getName () const =0
 Retrieves nodes name. More...
 
std::vector< Output * > getOutputRefs ()
 Retrieves reference to node outputs. More...
 
std::vector< const Output * > getOutputRefs () const
 Retrieves reference to node outputs. More...
 
std::vector< OutputgetOutputs ()
 Retrieves all nodes outputs. More...
 
Pipeline getParentPipeline ()
 
const Pipeline getParentPipeline () const
 
 Node (const std::shared_ptr< PipelineImpl > &p, Id nodeId, std::unique_ptr< Properties > props)
 Constructs Node. More...
 
virtual ~Node ()=default
 

Public Attributes

Input input {*this, "in", Input::Type::SReceiver, true, 5, true, {{DatatypeEnum::NNData, true}}}
 
Output out {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgDetections, false}}}
 
- Public Attributes inherited from dai::NodeCRTP< Node, DetectionParser, DetectionParserProperties >
Propertiesproperties
 Underlying properties. More...
 
- Public Attributes inherited from dai::Node
const Id id
 Id of node. More...
 
Propertiesproperties
 

Static Public Attributes

constexpr static const char * NAME = "DetectionParser"
 

Protected Member Functions

PropertiesgetProperties ()
 
- Protected Member Functions inherited from dai::Node
virtual tl::optional< OpenVINO::VersiongetRequiredOpenVINOVersion ()
 
void setInputMapRefs (InputMap *inMapRef)
 
void setInputMapRefs (std::initializer_list< InputMap * > l)
 
void setInputRefs (Input *inRef)
 
void setInputRefs (std::initializer_list< Input * > l)
 
void setOutputMapRefs (OutputMap *outMapRef)
 
void setOutputMapRefs (std::initializer_list< OutputMap * > l)
 
void setOutputRefs (Output *outRef)
 
void setOutputRefs (std::initializer_list< Output * > l)
 

Private Attributes

std::shared_ptr< RawEdgeDetectorConfigrawConfig
 

Additional Inherited Members

- Public Types inherited from dai::NodeCRTP< Node, DetectionParser, DetectionParserProperties >
using Properties = DetectionParserProperties
 
- Public Types inherited from dai::Node
using Id = std::int64_t
 Node identificator. Unique for every node on a single Pipeline. More...
 
- Protected Attributes inherited from dai::Node
AssetManager assetManager
 
std::unordered_map< std::string, InputMap * > inputMapRefs
 
std::unordered_map< std::string, Input * > inputRefs
 
std::unordered_map< std::string, OutputMap * > outputMapRefs
 
std::unordered_map< std::string, Output * > outputRefs
 
std::weak_ptr< PipelineImplparent
 
copyable_unique_ptr< PropertiespropertiesHolder
 

Detailed Description

DetectionParser node. Parses detection results from different neural networks and is being used internally by MobileNetDetectionNetwork and YoloDetectionNetwork.

Definition at line 18 of file DetectionParser.hpp.

Constructor & Destructor Documentation

◆ DetectionParser() [1/2]

dai::node::DetectionParser::DetectionParser ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId 
)

Definition at line 8 of file DetectionParser.cpp.

◆ DetectionParser() [2/2]

dai::node::DetectionParser::DetectionParser ( const std::shared_ptr< PipelineImpl > &  par,
int64_t  nodeId,
std::unique_ptr< Properties props 
)

Definition at line 10 of file DetectionParser.cpp.

Member Function Documentation

◆ getAnchorMasks()

std::map< std::string, std::vector< int > > dai::node::DetectionParser::getAnchorMasks ( ) const

Get anchor masks.

Definition at line 84 of file DetectionParser.cpp.

◆ getAnchors()

std::vector< float > dai::node::DetectionParser::getAnchors ( ) const

Get anchors.

Definition at line 79 of file DetectionParser.cpp.

◆ getConfidenceThreshold()

float dai::node::DetectionParser::getConfidenceThreshold ( ) const

Retrieves threshold at which to filter the rest of the detections.

Returns
Detection confidence

Definition at line 44 of file DetectionParser.cpp.

◆ getCoordinateSize()

int dai::node::DetectionParser::getCoordinateSize ( ) const

Get coordianate size.

Definition at line 74 of file DetectionParser.cpp.

◆ getIouThreshold()

float dai::node::DetectionParser::getIouThreshold ( ) const

Get Iou threshold.

Definition at line 89 of file DetectionParser.cpp.

◆ getNNFamily()

DetectionNetworkType dai::node::DetectionParser::getNNFamily ( )

Gets NN Family to parse

Definition at line 36 of file DetectionParser.cpp.

◆ getNumClasses()

int dai::node::DetectionParser::getNumClasses ( ) const

Get num classes.

Definition at line 69 of file DetectionParser.cpp.

◆ getNumFramesPool()

int dai::node::DetectionParser::getNumFramesPool ( )

Returns number of frames in pool

Definition at line 28 of file DetectionParser.cpp.

◆ getProperties()

DetectionParser::Properties & dai::node::DetectionParser::getProperties ( )
protectedvirtual

Reimplemented from dai::Node.

Definition at line 16 of file DetectionParser.cpp.

◆ setAnchorMasks()

void dai::node::DetectionParser::setAnchorMasks ( std::map< std::string, std::vector< int >>  anchorMasks)

Set anchor masks.

Definition at line 60 of file DetectionParser.cpp.

◆ setAnchors()

void dai::node::DetectionParser::setAnchors ( std::vector< float >  anchors)

Set anchors.

Definition at line 56 of file DetectionParser.cpp.

◆ setBlob()

void dai::node::DetectionParser::setBlob ( const OpenVINO::Blob blob)

Retrieves some input tensor information from the blob

Parameters
blobOpenVINO blob to retrieve the information from

Definition at line 20 of file DetectionParser.cpp.

◆ setConfidenceThreshold()

void dai::node::DetectionParser::setConfidenceThreshold ( float  thresh)

Specifies confidence threshold at which to filter the rest of the detections.

Parameters
threshDetection confidence must be greater than specified threshold to be added to the list

Definition at line 40 of file DetectionParser.cpp.

◆ setCoordinateSize()

void dai::node::DetectionParser::setCoordinateSize ( int  coordinates)

Set coordianate size.

Definition at line 52 of file DetectionParser.cpp.

◆ setIouThreshold()

void dai::node::DetectionParser::setIouThreshold ( float  thresh)

Set Iou threshold.

Definition at line 64 of file DetectionParser.cpp.

◆ setNNFamily()

void dai::node::DetectionParser::setNNFamily ( DetectionNetworkType  type)

Sets NN Family to parse

Definition at line 32 of file DetectionParser.cpp.

◆ setNumClasses()

void dai::node::DetectionParser::setNumClasses ( int  numClasses)

Set num classes.

Definition at line 48 of file DetectionParser.cpp.

◆ setNumFramesPool()

void dai::node::DetectionParser::setNumFramesPool ( int  numFramesPool)

Specify number of frames in pool.

Parameters
numFramesPoolHow many frames should the pool have

Definition at line 24 of file DetectionParser.cpp.

Member Data Documentation

◆ input

Input dai::node::DetectionParser::input {*this, "in", Input::Type::SReceiver, true, 5, true, {{DatatypeEnum::NNData, true}}}

Input NN results with detection data to parse Default queue is blocking with size 5

Definition at line 36 of file DetectionParser.hpp.

◆ NAME

constexpr static const char* dai::node::DetectionParser::NAME = "DetectionParser"
staticconstexpr

Definition at line 20 of file DetectionParser.hpp.

◆ out

Output dai::node::DetectionParser::out {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgDetections, false}}}

Outputs image frame with detected edges

Definition at line 41 of file DetectionParser.hpp.

◆ rawConfig

std::shared_ptr<RawEdgeDetectorConfig> dai::node::DetectionParser::rawConfig
private

Definition at line 26 of file DetectionParser.hpp.


The documentation for this class was generated from the following files:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20