5#include "../daoai_dl_sdk/include/export/model.h"
6#include "../daoai_dl_sdk/include/export/component_memory.h"
9using namespace System::Collections::Generic;
12 namespace DeepLearningCLI
18 static void initialize(
bool use_shared_memory,
int resevered_vram_size);
33 OCR = DaoAI::DeepLearning::ModelType::OCR,
38 Positioning = DaoAI::DeepLearning::ModelType::Positioning,
44 CPU = DaoAI::DeepLearning::DeviceType::CPU,
45 GPU = DaoAI::DeepLearning::DeviceType::GPU
49 PIXEL = DaoAI::DeepLearning::DetectionLevel::PIXEL,
50 IMAGE = DaoAI::DeepLearning::DetectionLevel::IMAGE
275 OCR(String^ model_config_path, String^ model_weight_path,
DeviceType device,
int device_idx);
430 cli::array<AutoSegmentationResult^>^
inference(cli::array<ImageEmbedding^>^ embeddings, cli::array<cli::array<Box^>^>^ boxes, cli::array<cli::array<Point^>^>^ points);
615 ComponentMemory(
const DaoAI::DeepLearning::ComponentMemory& component_memory);
621 void save(String^ file_path);
627 void load(String^ file_path);
664 cli::array<UnsupervisedDefectSegmentationResult^>^
inference(cli::array<Image^>^ images, cli::array<String^>^ component_names, cli::array<float>^ sensitivities);
static int getNumCUDADevices()
Definition model.cpp:12
static void initialize(bool use_shared_memory, int resevered_vram_size)
Definition model.cpp:8
Definition managed_object.h:18
cli::array< int > num_keypoints
Definition model.h:60
cli::array< String^> class_labels
Definition model.h:59
ModelType model_type
Definition model.h:57
DeviceType device
Definition model.h:58
cli::array< String^> keypoint_labels
Definition model.h:61
int getBatchSize()
Get the batch size for the model.
Definition model.cpp:146
AutoSegmentationResult inference(ImageEmbedding^ embedding, cli::array< Point^>^ points)
Run inferent on image.
Definition model.cpp:151
void setBatchSize(int batch_size)
Set the batch size for the model.
Definition model.cpp:141
cli::array< ImageEmbedding^> generateImageEmbeddings(cli::array< Image^>^ images)
Generate image embeddings for a list of images.
Definition model.cpp:209
AutoSegmentation(String^ model_file_path, DeviceType device, int device_idx)
Construct model specified by model path onto the designated device.
Definition model.cpp:108
ModelInfo getModelInfo()
Get the model info for the model.
Definition model.cpp:120
Definition prediction.h:446
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...
Definition prediction.h:365
void load(String^ file_path)
Load the component memory from a file.
Definition model.cpp:248
ComponentMemory(String^ file_path)
Construct a component memory object.
Definition model.cpp:231
void save(String^ file_path)
Save the component memory to a file.
Definition model.cpp:242
Definition prediction.h:482
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
Definition prediction.h:94
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.
Definition prediction.h:177
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.
Definition prediction.h:275
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.
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...
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.
Definition prediction.h:604
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.
Definition prediction.h:526
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.
Definition prediction.h:406
void removeComponentMemory(String^ component_name)
Remove a component memory from the component memory list.
Definition model.cpp:325
void addComponentMemory(String^ component_name, String^ component_memory_file_path)
Add a component memory to the component memory list.
Definition model.cpp:305
UnsupervisedDefectSegmentationResult inference(Image^ image)
Run inference on image.
Definition model.cpp:259
void setDetectionLevel(DetectionLevel value)
Set the detection level for the base model, whether image-level or pixel-level.
Definition model.cpp:341
int getBatchSize()
Get the batch size for the model.
Definition model.cpp:300
UnsupervisedDefectSegmentation(DeviceType device)
Construct model specified by its configuration and weight file paths onto the designated device.
Definition model.cpp:254
void addComponentArchive(String^ archive_path)
Add a component memory archive to the component memory list.
Definition model.cpp:319
Dictionary< String^, ComponentMemory^> listComponentMemory()
Get the list of component memory objects.
Definition model.cpp:331
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:346
void setBatchSize(int batch_size)
Set the batch size for the model.
Definition model.cpp:295
Definition prediction.h:757
DeviceType
Definition model.h:43
ModelType
Definition model.h:28
@ Unsupervised_Defect_Segmentation
@ Supervised_Defect_Segmentation
DetectionLevel
Definition model.h:48