5#include "../daoai_dl_sdk/include/export/dwsdk/model.h"
6#include "../daoai_dl_sdk/include/export/dwsdk/component_memory.h"
9using namespace System::Collections::Generic;
12 namespace DeepLearningCLI
34 OCR = DaoAI::DeepLearning::ModelType::OCR,
40 Positioning = DaoAI::DeepLearning::ModelType::Positioning,
46 CPU = DaoAI::DeepLearning::DeviceType::CPU,
47 GPU = DaoAI::DeepLearning::DeviceType::GPU
51 PIXEL_FAST = DaoAI::DeepLearning::Vision::DetectionLevel::PIXEL_FAST,
52 PIXEL_ACCURATE = DaoAI::DeepLearning::Vision::DetectionLevel::PIXEL_ACCURATE,
53 IMAGE = DaoAI::DeepLearning::Vision::DetectionLevel::IMAGE
96 cli::array<ObjectDetectionResult^>^
inference(cli::array<Image^>^ images);
161 cli::array<RotatedObjectDetectionResult^>^
inference(cli::array<Image^>^ images);
227 cli::array<MultilabelDetectionResult^>^
inference(cli::array<Image^>^ images);
292 cli::array<InstanceSegmentationResult^>^
inference(cli::array<Image^>^ images);
356 cli::array<KeypointDetectionResult^>^
inference(cli::array<Image^>^ images);
421 cli::array<OCRResult^>^
inference(cli::array<Image^>^ images);
462 cli::array<ClassificationResult^>^
inference(cli::array<Image^>^ images);
503 cli::array<SupervisedDefectSegmentationResult^>^
inference(cli::array<Image^>^ images);
556 cli::array<AutoSegmentationResult^>^
inference(cli::array<ImageEmbedding^>^ embeddings, cli::array<cli::array<Box^>^>^ boxes, cli::array<cli::array<Point^>^>^ points);
616 cli::array<PresenceCheckingResult^>^
inference(cli::array<Image^>^ images);
687 cli::array<PositioningResult^>^
inference(cli::array<Image^>^ images);
743 ComponentMemory(
const DaoAI::DeepLearning::ComponentMemory& component_memory);
773 void save(String^ file_path);
779 void load(String^ file_path);
805 cli::array<UnsupervisedDefectSegmentationResult^>^
inference(cli::array<Image^>^ images);
821 cli::array<UnsupervisedDefectSegmentationResult^>^
inference(cli::array<Image^>^ images, cli::array<String^>^ component_names);
static int getNumCUDADevices()
Definition model.cpp:12
static void initialize()
Definition model.cpp:8
Definition managed_object.h:60
: Deprecated, will be removed in the future
Definition model.h:61
cli::array< int > num_keypoints
Definition model.h:66
cli::array< String^> class_labels
Definition model.h:65
ModelType model_type
Definition model.h:63
DeviceType device
Definition model.h:64
cli::array< String^> keypoint_labels
Definition model.h:67
int getBatchSize()
Get the batch size for the model.
Definition model.cpp:153
AutoSegmentationResult inference(ImageEmbedding^ embedding, cli::array< Point^>^ points)
Run inferent on image.
Definition model.cpp:158
void setBatchSize(int batch_size)
Set the batch size for the model.
Definition model.cpp:148
cli::array< ImageEmbedding^> generateImageEmbeddings(cli::array< Image^>^ images)
Generate image embeddings for a list of images.
Definition model.cpp:216
AutoSegmentation(String^ model_file_path, DeviceType device, int device_idx)
Construct model specified by model path onto the designated device.
Definition model.cpp:115
ModelInfo getModelInfo()
Get the model info for the model.
Definition model.cpp:127
Definition prediction.h:612
int getBatchSize()
Get the batch size for the model.
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...
cli::array< ClassificationResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
Definition prediction.h:531
float getImageThreshold()
get the image threshold
Definition model.cpp:266
void setImageThreshold(float value)
set the image threshold
Definition model.cpp:261
void setPixelThreshold(float value)
set the pixel threshold
Definition model.cpp:271
void load(String^ file_path)
Load the component memory from a file.
Definition model.cpp:255
float getPixelThreshold()
get the pixel threshold
Definition model.cpp:276
ComponentMemory(String^ file_path)
Construct a component memory object.
Definition model.cpp:238
void save(String^ file_path)
Save the component memory to a file.
Definition model.cpp:249
Definition prediction.h:648
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.
cli::array< InstanceSegmentationResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
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.
Definition prediction.h:260
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
cli::array< KeypointDetectionResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
int getBatchSize()
Get the batch size for the model.
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.
Definition prediction.h:343
MultilabelDetectionResult inference(Image^ image)
: Run inferent on image
float getConfidenceThreshold()
Get the confidence 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.
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
float getIOUThreshold()
Get the IOU threshold for the model.
MultilabelDetection(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...
cli::array< MultilabelDetectionResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
int getBatchSize()
Get the batch size for the model.
Definition prediction.h:94
void setBatchSize(int batch_size)
Set the batch size for the model.
OCRResult inference(Image^ image)
: Run inferent on image
cli::array< OCRResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
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.
Definition prediction.h:441
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.
cli::array< ObjectDetectionResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
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.
Definition prediction.h:14
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...
cli::array< PositioningResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
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.
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.
Definition prediction.h:770
cli::array< PresenceCheckingResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
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...
ModelInfo getModelInfo()
: Run inferent on multiple images
float getConfidenceThreshold()
Get the confidence threshold for the model.
void setIOUThreshold(float threshold)
Set the IOU threshold for the model.
Definition prediction.h:692
void setBatchSize(int batch_size)
Set the batch size for the model.
float getIOUThreshold()
Get the IOU threshold for the model.
int getBatchSize()
Get the batch size for the model.
RotatedObjectDetectionResult inference(Image^ image)
: Run inferent on image
void setConfidenceThreshold(float threshold)
Set the confidence threshold for the model.
cli::array< RotatedObjectDetectionResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
RotatedObjectDetection(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.
Definition prediction.h:185
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
cli::array< SupervisedDefectSegmentationResult^> inference(cli::array< Image^>^ images)
: Run inferent on multiple images
void setBatchSize(int batch_size)
Set the batch size for the model.
Definition prediction.h:572
void removeComponentMemory(String^ component_name)
Remove a component memory from the component memory list.
Definition model.cpp:362
void addComponentMemory(String^ component_name, String^ component_memory_file_path)
Add a component memory to the component memory list.
Definition model.cpp:342
UnsupervisedDefectSegmentationResult inference(Image^ image)
Run inference on image.
Definition model.cpp:286
void setDetectionLevel(DetectionLevel value)
Set the detection level for the base model, whether image-level or pixel-level.
Definition model.cpp:378
int getBatchSize()
Get the batch size for the model.
Definition model.cpp:337
UnsupervisedDefectSegmentation(DeviceType device)
Construct model specified by its configuration and weight file paths onto the designated device.
Definition model.cpp:281
void addComponentArchive(String^ archive_path)
Add a component memory archive to the component memory list.
Definition model.cpp:356
Dictionary< String^, ComponentMemory^> listComponentMemory()
Get the list of component memory objects.
Definition model.cpp:368
ComponentMemory createComponentMemory(String^ component_name, cli::array< Image^>^ good_images, cli::array< Image^>^ bad_images, cli::array< Image^>^ masks, bool append_memory)
Train a component memory.
Definition model.cpp:383
void setBatchSize(int batch_size)
Set the batch size for the model.
Definition model.cpp:332
Definition prediction.h:923
DeviceType
Definition model.h:45
ModelType
Definition model.h:28
@ Unsupervised_Defect_Segmentation
@ Supervised_Defect_Segmentation
@ Rotated_Object_Detection
DetectionLevel
Definition model.h:50