DaoAI World Inference Client Industrial 2.24.7.0
Loading...
Searching...
No Matches
prediction.h
Go to the documentation of this file.
1#pragma once
2#include "common.h"
3#include <unordered_map>
4#include "config.h"
5namespace DaoAI
6{
7 namespace DeepLearning
8 {
10 {
11 public:
12
13#ifndef BUILD_INFERENCE_CLIENT
17 virtual std::string toJSONString() { return ""; }
18
22 virtual std::string toAnnotationJSONString() { return ""; }
23#endif // !BUILD_INFERENCE_CLIENT
24
25
28 };
29
30
31 namespace Vision
32 {
34 {
35 public:
37#ifndef BUILD_INFERENCE_CLIENT
38 DAOAI_API std::string toJSONString() override;
39 DAOAI_API std::string toAnnotationJSONString() override;
40#else
41 DAOAI_API ObjectDetectionResult(const std::string& json_result);
42#endif // !BUILD_INFERENCE_CLIENT
43
44 size_t num_detections = 0;
45 std::vector<Box> boxes;
46 std::vector<double> confidences;
47 std::vector<int> class_ids;
48 std::vector<std::string> class_labels;
49 std::string decision;
50 };
51
53 {
54 public:
56#ifndef BUILD_INFERENCE_CLIENT
57 DAOAI_API std::string toJSONString() override;
58 DAOAI_API std::string toAnnotationJSONString() override;
59#else
60 DAOAI_API InstanceSegmentationResult(const std::string& json_result);
61#endif // !BUILD_INFERENCE_CLIENT
62
63 size_t num_detections = 0;
64 std::vector<Box> boxes;
65 std::vector<Mask> masks;
66 std::vector<double> confidences;
67 std::vector<int> class_ids;
68 std::vector<std::string> class_labels;
69 };
70
72 {
73 public:
75#ifndef BUILD_INFERENCE_CLIENT
76 DAOAI_API std::string toJSONString() override;
77 DAOAI_API std::string toAnnotationJSONString() override;
78#else
79 DAOAI_API KeypointDetectionResult(const std::string& json_result);
80#endif // !BUILD_INFERENCE_CLIENT
81
82 size_t num_detections = 0;
83 std::vector<Box> boxes;
84 std::vector<Mask> masks;
85 std::vector<std::vector<Point>> keypoints;
86 std::vector<double> confidences;
87 std::vector<int> class_ids;
88 std::vector<std::string> class_labels;
89 };
90
92 {
93 public:
95
96#ifndef BUILD_INFERENCE_CLIENT
97 DAOAI_API std::string toJSONString() override;
98 DAOAI_API std::string toAnnotationJSONString() override;
99
100#else
101 DAOAI_API SemanticSegmentationResult(const std::string& json_result);
102#endif // !BUILD_INFERENCE_CLIENT
103
104 std::unordered_map<std::string, Mask> masks;
105 };
106
107 class OCRResult final : public Prediction
108 {
109 public:
111#ifndef BUILD_INFERENCE_CLIENT
112 DAOAI_API std::string toJSONString() override;
113 DAOAI_API std::string toAnnotationJSONString() override;
114#else
115 DAOAI_API OCRResult(const std::string& json_result);
116#endif // !BUILD_INFERENCE_CLIENT
117
118 size_t num_detections = 0;
119 std::vector<Polygon> boxes;
120 std::vector<double> confidences;
121 std::vector<std::string> texts;
122 };
124 {
125 public:
127#ifndef BUILD_INFERENCE_CLIENT
128 DAOAI_API std::string toJSONString() override;
129 DAOAI_API std::string toAnnotationJSONString() override;
130#else
131 DAOAI_API AnomalyDetectionResult(const std::string& json_result);
132#endif // !BUILD_INFERENCE_CLIENT
133
134 int label_id = -1;
135 std::string label = "";
137 double confidence = -1;
138 };
139 class ClassificationResult final : public Prediction
140 {
141 public:
143#ifndef BUILD_INFERENCE_CLIENT
144 DAOAI_API std::string toJSONString() override;
145 DAOAI_API std::string toAnnotationJSONString() override;
146#else
147 DAOAI_API ClassificationResult(const std::string& json_result);
148#endif // !BUILD_INFERENCE_CLIENT
149
150 struct Flag
151 {
152 double confidence = -1;
153 std::string label = "";
154 };
155
156 std::vector<Flag> flags;
157 bool multilabel = false;
158 };
159
161 {
162 public:
164#ifndef BUILD_INFERENCE_CLIENT
166 DAOAI_API std::string toJSONString() override;
167#else
168 DAOAI_API SupervisedDefectSegmentationResult(const std::string& json_result);
169#endif // !BUILD_INFERENCE_CLIENT
170
171 std::string decision;
172 };
173
175 {
176 public:
178#ifndef BUILD_INFERENCE_CLIENT
179 PositioningResult(const KeypointDetectionResult& keypoint_result);
180 DAOAI_API std::string toJSONString() override;
181#else
182 DAOAI_API PositioningResult(const std::string& json_result);
183#endif // !BUILD_INFERENCE_CLIENT
184
185 std::string decision;
186 };
187
189 {
190 public:
192#ifndef BUILD_INFERENCE_CLIENT
194 DAOAI_API std::string toJSONString() override;
195#else
196 DAOAI_API UnsupervisedDefectSegmentationResult(const std::string& json_result);
197#endif // !BUILD_INFERENCE_CLIENT
198
199 std::string decision;
200 };
201
203 {
204 public:
206#ifndef BUILD_INFERENCE_CLIENT
207 PresenceCheckingResult(const ObjectDetectionResult& object_result);
208#else
209 DAOAI_API PresenceCheckingResult(const std::string& json_result);
210#endif // !BUILD_INFERENCE_CLIENT
211 };
212 }
213 }
214}
#define DAOAI_API
Definition API_EXPORT.h:6
Definition common.h:240
Definition prediction.h:10
int image_width
Definition prediction.h:26
int image_height
Definition prediction.h:27
std::string label
Definition prediction.h:135
double confidence
Definition prediction.h:137
DAOAI_API AnomalyDetectionResult(const std::string &json_result)
bool multilabel
Definition prediction.h:157
std::vector< Flag > flags
Definition prediction.h:156
DAOAI_API ClassificationResult(const std::string &json_result)
std::vector< Mask > masks
Definition prediction.h:65
std::vector< int > class_ids
Definition prediction.h:67
std::vector< std::string > class_labels
Definition prediction.h:68
std::vector< double > confidences
Definition prediction.h:66
std::vector< Box > boxes
Definition prediction.h:64
DAOAI_API InstanceSegmentationResult(const std::string &json_result)
std::vector< Mask > masks
Definition prediction.h:84
std::vector< double > confidences
Definition prediction.h:86
std::vector< Box > boxes
Definition prediction.h:83
size_t num_detections
Definition prediction.h:82
std::vector< std::string > class_labels
Definition prediction.h:88
std::vector< int > class_ids
Definition prediction.h:87
DAOAI_API KeypointDetectionResult(const std::string &json_result)
std::vector< std::vector< Point > > keypoints
Definition prediction.h:85
Definition prediction.h:108
DAOAI_API OCRResult(const std::string &json_result)
size_t num_detections
Definition prediction.h:118
std::vector< Polygon > boxes
Definition prediction.h:119
std::vector< std::string > texts
Definition prediction.h:121
std::vector< double > confidences
Definition prediction.h:120
std::vector< std::string > class_labels
Definition prediction.h:48
std::vector< Box > boxes
Definition prediction.h:45
std::vector< double > confidences
Definition prediction.h:46
std::string decision
Definition prediction.h:49
std::vector< int > class_ids
Definition prediction.h:47
size_t num_detections
Definition prediction.h:44
DAOAI_API ObjectDetectionResult(const std::string &json_result)
std::string decision
Definition prediction.h:185
DAOAI_API PositioningResult(const std::string &json_result)
DAOAI_API PresenceCheckingResult(const std::string &json_result)
DAOAI_API SemanticSegmentationResult(const std::string &json_result)
std::unordered_map< std::string, Mask > masks
Definition prediction.h:104
DAOAI_API SupervisedDefectSegmentationResult(const std::string &json_result)
DAOAI_API UnsupervisedDefectSegmentationResult(const std::string &json_result)
Definition common.h:7
std::string label
Definition prediction.h:153