DaoAI World C# SDK industrial 2.24.8.0
Loading...
Searching...
No Matches
model.h
Go to the documentation of this file.
1#pragma once
2#include "managed_object.h"
3#include "common.h"
4#include "prediction.h"
5#include "../daoai_dl_sdk/include/export/model.h"
6
7using namespace System;
8namespace DaoAI
9{
10 namespace DeepLearningCLI
11 {
12 public ref class Application
13 {
14 public:
15 // Initialize DaoAI Deep Learning SDK
16 static void initialize(bool use_shared_memory, int resevered_vram_size);
17
22 static int getNumCUDADevices();
23 };
24
25 public enum class ModelType : int
26 {
27 Object_Detection = DaoAI::DeepLearning::ModelType::Object_Detection,
28 Instance_Segmentation = DaoAI::DeepLearning::ModelType::Instance_Segmentation,
29 Keypoint_Detection = DaoAI::DeepLearning::ModelType::Keypoint_Detection,
30 Classification = DaoAI::DeepLearning::ModelType::Classification,
31 OCR = DaoAI::DeepLearning::ModelType::OCR,
32 Supervised_Defect_Segmentation = DaoAI::DeepLearning::ModelType::Supervised_Defect_Segmentation,
33#ifdef INDUSTRIAL
34 Presence_Checking = DaoAI::DeepLearning::ModelType::Presence_Checking,
35 Positioning = DaoAI::DeepLearning::ModelType::Positioning
36#endif // INDUSTRIAL
37 };
38
39 public enum class DeviceType {
40 CPU = DaoAI::DeepLearning::DeviceType::CPU,
41 GPU = DaoAI::DeepLearning::DeviceType::GPU
42 };
43
44 public ref class ModelInfo
45 {
46 public:
49 cli::array<String^>^ class_labels;
50 cli::array<int>^ num_keypoints;
51 cli::array<String^>^ keypoint_labels;
52 };
53
54 namespace Vision
55 {
56 public ref class ObjectDetection : public ManagedObject<DaoAI::DeepLearning::Vision::ObjectDetection>
57 {
58 public:
59
66 ObjectDetection(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
67
74 ObjectDetection(String^ model_file_path, DeviceType device, int device_idx);
75
76
83
85
90 void setBatchSize(int batch_size);
91
97
102 void setConfidenceThreshold(float threshold);
103
109
114 void setIOUThreshold(float threshold);
115
121 };
122
123 public ref class InstanceSegmentation : public ManagedObject<DaoAI::DeepLearning::Vision::InstanceSegmentation>
124 {
125 public:
126
133 InstanceSegmentation(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
134
141 InstanceSegmentation(String^ model_file_path, DeviceType device, int device_idx);
142
149
151
156 void setBatchSize(int batch_size);
157
163
168 void setConfidenceThreshold(float threshold);
169
175
180 void setIOUThreshold(float threshold);
181
187 };
188
189 public ref class KeypointDetection : public ManagedObject<DaoAI::DeepLearning::Vision::KeypointDetection>
190 {
191 public:
192
199 KeypointDetection(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
200
207 KeypointDetection(String^ model_file_path, DeviceType device, int device_idx);
208
215
217
222 void setBatchSize(int batch_size);
223
229
234 void setConfidenceThreshold(float threshold);
235
241
246 void setIOUThreshold(float threshold);
247
253 };
254
255 public ref class OCR : public ManagedObject<DaoAI::DeepLearning::Vision::OCR>
256 {
257 public:
258
265 OCR(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
266
273 OCR(String^ model_file_path, DeviceType device, int device_idx);
274
275
282
284
289 void setBatchSize(int batch_size);
290
296 };
297
298 public ref class Classification : public ManagedObject<DaoAI::DeepLearning::Vision::Classification>
299 {
300 public:
301
308 Classification(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
309
316 Classification(String^ model_file_path, DeviceType device, int device_idx);
317
318
325
327
332 void setBatchSize(int batch_size);
333
339 };
340
341 public ref class SupervisedDefectSegmentation : public ManagedObject<DaoAI::DeepLearning::Vision::SupervisedDefectSegmentation>
342 {
343 public:
344
351 SupervisedDefectSegmentation(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
352
359 SupervisedDefectSegmentation(String^ model_file_path, DeviceType device, int device_idx);
360
361
368
370
375 void setBatchSize(int batch_size);
376
382 };
383
384#ifdef INDUSTRIAL
385 public ref class PresenceChecking : public ManagedObject<DaoAI::DeepLearning::Vision::PresenceChecking>
386 {
387 public:
388
395 PresenceChecking(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
396
403 PresenceChecking(String^ model_file_path, DeviceType device, int device_idx);
404
405
412
414
419 void setBatchSize(int batch_size);
420
426
431 void setConfidenceThreshold(float threshold);
432
438
443 void setIOUThreshold(float threshold);
444
450 };
451
452 public ref class Positioning : public ManagedObject<DaoAI::DeepLearning::Vision::Positioning>
453 {
454 public:
455
462 Positioning(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx);
463
470 Positioning(String^ model_file_path, DeviceType device, int device_idx);
471
472
479
481
486 void setBatchSize(int batch_size);
487
493
498 void setConfidenceThreshold(float threshold);
499
505
510 void setIOUThreshold(float threshold);
511
517 };
518
519#endif // INDUSTRIAL
520 }
521 }
522}
static int getNumCUDADevices()
Definition model.cpp:12
static void initialize(bool use_shared_memory, int resevered_vram_size)
Definition model.cpp:8
Definition common.h:169
Definition managed_object.h:18
cli::array< int > num_keypoints
Definition model.h:50
cli::array< String^> class_labels
Definition model.h:49
ModelType model_type
Definition model.h:47
DeviceType device
Definition model.h:48
cli::array< String^> keypoint_labels
Definition model.h:51
int getBatchSize()
Get the batch size for the model.
Classification(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
ClassificationResult inference(Image^ image)
: Run inferent on image
void setBatchSize(int batch_size)
Set the batch size for the model.
Classification(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
InstanceSegmentationResult inference(Image^ image)
: Run inferent on image
float getIOUThreshold()
Get the IOU threshold for the model.
void setBatchSize(int batch_size)
Set the batch size for the model.
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
InstanceSegmentation(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
float getConfidenceThreshold()
Get the confidence threshold for the model.
int getBatchSize()
Get the batch size for the model.
InstanceSegmentation(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
KeypointDetection(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
KeypointDetectionResult inference(Image^ image)
: Run inferent on image
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
int getBatchSize()
Get the batch size for the model.
KeypointDetection(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
float getIOUThreshold()
Get the IOU threshold for the model.
float getConfidenceThreshold()
Get the confidence threshold for the model.
void setBatchSize(int batch_size)
Set the batch size for the model.
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
void setBatchSize(int batch_size)
Set the batch size for the model.
OCRResult inference(Image^ image)
: Run inferent on image
OCR(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
OCR(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
int getBatchSize()
Get the batch size for the model.
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
ObjectDetectionResult inference(Image^ image)
: Run inferent on image
void setBatchSize(int batch_size)
Set the batch size for the model.
ObjectDetection(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
int getBatchSize()
Get the batch size for the model.
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
ObjectDetection(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
float getIOUThreshold()
Get the IOU threshold for the model.
float getConfidenceThreshold()
Get the confidence threshold for the model.
Positioning(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
PositioningResult inference(Image^ image)
: Run inferent on image
float getConfidenceThreshold()
Get the confidence threshold for the model.
float getIOUThreshold()
Get the IOU threshold for the model.
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
Positioning(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
void setBatchSize(int batch_size)
Set the batch size for the model.
int getBatchSize()
Get the batch size for the model.
PresenceChecking(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
PresenceCheckingResult inference(Image^ image)
: Run inferent on image
int getBatchSize()
Get the batch size for the model.
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
float getIOUThreshold()
Get the IOU threshold for the model.
void setBatchSize(int batch_size)
Set the batch size for the model.
PresenceChecking(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
float getConfidenceThreshold()
Get the confidence threshold for the model.
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
SupervisedDefectSegmentation(String^ model_config_path, String^ model_weight_path, DeviceType device, int device_idx)
: Construct model specified by its configuration and weight file paths onto the designated device
int getBatchSize()
Get the batch size for the model.
SupervisedDefectSegmentation(String^ model_file_path, DeviceType device, int device_idx)
: Load the model specified by its configuration and weight files from the model directory onto the de...
SupervisedDefectSegmentationResult inference(Image^ image)
: Run inferent on image
void setBatchSize(int batch_size)
Set the batch size for the model.
DeviceType
Definition model.h:39
ModelType
Definition model.h:26
Definition common.cpp:6