NeuralNetwork.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 // standard
7 #include <fstream>
8 
9 // shared
11 
12 namespace dai {
13 namespace node {
14 
18 class NeuralNetwork : public NodeCRTP<Node, NeuralNetwork, NeuralNetworkProperties> {
19  public:
20  constexpr static const char* NAME = "NeuralNetwork";
21 
22  protected:
25 
26  public:
27  NeuralNetwork(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
28  NeuralNetwork(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props);
29 
34  Input input{*this, "in", Input::Type::SReceiver, true, 5, true, {{DatatypeEnum::Buffer, true}}};
35 
39  Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::NNData, false}}};
40 
46  Output passthrough{*this, "passthrough", Output::Type::MSender, {{DatatypeEnum::Buffer, true}}};
47 
53 
57  OutputMap passthroughs;
58 
59  // Specify local filesystem path to load the blob (which gets loaded at loadAssets)
66  void setBlobPath(const dai::Path& path);
67 
73  void setBlob(OpenVINO::Blob blob);
74 
81  void setBlob(const dai::Path& path);
82 
87  void setNumPoolFrames(int numFrames);
88 
93  void setNumInferenceThreads(int numThreads);
94 
99  void setNumNCEPerInferenceThread(int numNCEPerThread);
100 
106  // TODO add getters for other API
107 };
108 
109 } // namespace node
110 } // namespace dai
dai::node::NeuralNetwork::setBlob
void setBlob(OpenVINO::Blob blob)
Definition: NeuralNetwork.cpp:34
dai::OpenVINO::Blob
OpenVINO Blob.
Definition: OpenVINO.hpp:23
dai::node::NeuralNetwork::inputs
InputMap inputs
Definition: NeuralNetwork.hpp:52
dai::node::NeuralNetwork::getRequiredOpenVINOVersion
tl::optional< OpenVINO::Version > getRequiredOpenVINOVersion() override
Definition: NeuralNetwork.cpp:21
dai::node::NeuralNetwork::setNumPoolFrames
void setNumPoolFrames(int numFrames)
Definition: NeuralNetwork.cpp:41
dai::DatatypeEnum::Buffer
@ Buffer
dai::node::NeuralNetwork
NeuralNetwork node. Runs a neural inference on input data.
Definition: NeuralNetwork.hpp:18
dai::NodeCRTP
Definition: Node.hpp:342
dai::node::NeuralNetwork::input
Input input
Definition: NeuralNetwork.hpp:34
dai::node::NeuralNetwork::setNumNCEPerInferenceThread
void setNumNCEPerInferenceThread(int numNCEPerThread)
Definition: NeuralNetwork.cpp:49
dai::Node::Input
Definition: Node.hpp:147
dai::node::NeuralNetwork::setBlobPath
void setBlobPath(const dai::Path &path)
Definition: NeuralNetwork.cpp:26
dai::node::NeuralNetwork::passthroughs
OutputMap passthroughs
Definition: NeuralNetwork.hpp:57
dai::node::NeuralNetwork::passthrough
Output passthrough
Definition: NeuralNetwork.hpp:46
OpenVINO.hpp
dai::DatatypeEnum::NNData
@ NNData
tl::optional< OpenVINO::Version >
dai::node::NeuralNetwork::setNumInferenceThreads
void setNumInferenceThreads(int numThreads)
Definition: NeuralNetwork.cpp:45
dai::node::NeuralNetwork::NeuralNetwork
NeuralNetwork(const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
Definition: NeuralNetwork.cpp:9
dai::node::NeuralNetwork::getNumInferenceThreads
int getNumInferenceThreads()
Definition: NeuralNetwork.cpp:53
dai::Path
Represents paths on a filesystem; accepts utf-8, Windows utf-16 wchar_t, or std::filesystem::path.
Definition: Path.hpp:27
dai::Node::InputMap
Definition: Node.hpp:258
dai
Definition: CameraExposureOffset.hpp:6
Node.hpp
dai::node::NeuralNetwork::networkOpenvinoVersion
tl::optional< OpenVINO::Version > networkOpenvinoVersion
Definition: NeuralNetwork.hpp:24
dai::node::NeuralNetwork::out
Output out
Definition: NeuralNetwork.hpp:39
NeuralNetworkProperties.hpp
dai::node::NeuralNetwork::NAME
constexpr static const char * NAME
Definition: NeuralNetwork.hpp:20


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