Skip to main content

SimaBoxDecode.h File

SimaAI box decode node wrapper. More...

Included Headers

#include "builder/ConfigJsonConsumer.h" #include "builder/ConfigJsonOverride.h" #include "builder/ConfigJsonProvider.h" #include "builder/Node.h" #include "builder/OutputSpec.h" #include <functional> #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

classSimaBoxDecode

Description

SimaAI box decode node wrapper.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
8#include "builder/ConfigJsonConsumer.h"
9#include "builder/ConfigJsonOverride.h"
10#include "builder/ConfigJsonProvider.h"
11#include "builder/Node.h"
12#include "builder/OutputSpec.h"
13
14#include <functional>
15#include <memory>
16#include <string>
17#include <vector>
18
19namespace simaai::neat {
20class Model;
21} // namespace simaai::neat
22
23namespace simaai::neat {
24
25struct BoxDecodeOptionsInternal;
26
27class SimaBoxDecode final : public Node,
28 public OutputSpecProvider,
29 public ConfigJsonProvider,
30 public ConfigJsonOverride,
31 public ConfigJsonConsumer {
32public:
33 explicit SimaBoxDecode(const simaai::neat::Model& model, const std::string& decode_type = "",
34 int original_width = 0, int original_height = 0,
35 double detection_threshold = 0.0, double nms_iou_threshold = 0.0,
36 int top_k = 0);
37
38 std::string kind() const override {
39 return "SimaBoxDecode";
40 }
41 NodeCapsBehavior caps_behavior() const override {
42 return NodeCapsBehavior::Static;
43 }
44 bool has_config_json() const override;
45 bool wire_input_names(const std::vector<std::string>& upstream_names,
46 const std::string& tag) override;
47 std::string backend_fragment(int node_index) const override;
48 std::vector<std::string> element_names(int node_index) const override;
49 OutputSpec output_spec(const OutputSpec& input) const override;
50
51 const std::string& config_path() const {
52 return config_path_;
53 }
54 const nlohmann::json* config_json() const override;
55 bool override_config_json(const std::function<void(nlohmann::json&)>& edit,
56 const std::string& tag) override;
57 void apply_upstream_config(const nlohmann::json& upstream,
58 const std::string& upstream_kind) override;
59
60private:
61 struct BoxDecodeConfigHolder;
62
63 std::unique_ptr<BoxDecodeOptionsInternal> opt_;
64 std::shared_ptr<BoxDecodeConfigHolder> config_holder_;
65 std::string config_path_;
66};
67
68} // namespace simaai::neat
69
70namespace simaai::neat::nodes {
71std::shared_ptr<simaai::neat::Node> SimaBoxDecode(const simaai::neat::Model& model,
72 const std::string& decode_type = "",
73 int original_width = 0, int original_height = 0,
74 double detection_threshold = 0.0,
75 double nms_iou_threshold = 0.0, int top_k = 0);
76} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.