Program Listing for File DetectionParser.hpp

Return to documentation for file (include/depthai/pipeline/node/DetectionParser.hpp)

#pragma once

#include <depthai/pipeline/Node.hpp>

// standard
#include <fstream>

// shared
#include <depthai-shared/properties/DetectionParserProperties.hpp>

namespace dai {
namespace node {

class DetectionParser : public NodeCRTP<Node, DetectionParser, DetectionParserProperties> {
   public:
    constexpr static const char* NAME = "DetectionParser";

   protected:
    Properties& getProperties();

   private:
    std::shared_ptr<RawEdgeDetectorConfig> rawConfig;

   public:
    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);

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

    Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgDetections, false}}};

    void setNumFramesPool(int numFramesPool);

    int getNumFramesPool();

    void setBlob(const OpenVINO::Blob& blob);

    void setNNFamily(DetectionNetworkType type);

    DetectionNetworkType getNNFamily();

    void setConfidenceThreshold(float thresh);

    float getConfidenceThreshold() const;

    void setNumClasses(int numClasses);
    void setCoordinateSize(int coordinates);
    void setAnchors(std::vector<float> anchors);
    void setAnchorMasks(std::map<std::string, std::vector<int>> anchorMasks);
    void setIouThreshold(float thresh);

    int getNumClasses() const;
    int getCoordinateSize() const;
    std::vector<float> getAnchors() const;
    std::map<std::string, std::vector<int>> getAnchorMasks() const;
    float getIouThreshold() const;
};

}  // namespace node
}  // namespace dai