16 namespace DeepLearning
28 DAOAI_API void initialize(
const bool& use_shared_memory =
false,
const size_t& reserved_vram_size = 500000000);
76 class UnsupervisedDefectSegmentationImpl;
156 DAOAI_API std::vector<SupervisedDefectSegmentationResult>
inference(
const std::vector<Image>& images);
164 DAOAI_API std::vector<AutoSegmentationResult>
inference(
const std::vector<ImageEmbedding>& embeddings,
const std::vector<std::vector<Box>>& boxes,
const std::vector<std::vector<Point>>& points = std::vector<std::vector<Point>>());
165 DAOAI_API std::vector<AutoSegmentationResult>
inference(
const std::vector<ImageEmbedding>& embeddings,
const std::vector<std::vector<Point>>& points);
211 const Image& image,
const std::string& component_name,
float sensitivity);
221 const std::vector<Image>& images,
222 const std::vector<std::string>& component_names,
223 const std::vector<float>& sensitivities);
225 DAOAI_API std::vector<UnsupervisedDefectSegmentationResult>
inference(
const std::vector<Image>& images);
277 DAOAI_API ComponentMemory createComponentMemory(
const std::string& component_name,
const std::vector<Image>& good_images,
const std::vector<Image>& bad_images = {},
const std::vector<Image>& masks = {},
const bool& append_memory =
false);
280 std::shared_ptr<UnsupervisedDefectSegmentationImpl> impl_ =
nullptr;
#define DAOAI_API
Definition API_EXPORT.h:13
Definition component_memory.h:14
DAOAI_API ModelInfo getModelInfo()
virtual DAOAI_API ~Model()
std::shared_ptr< ModelInstance > model_instance_
Definition model.h:73
DAOAI_API void setBatchSize(const size_t &batch_size)
DAOAI_API size_t getBatchSize() const
Model(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DaoAI::DeepLearning::DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
Model(const std::filesystem::path &model_path, const DaoAI::DeepLearning::DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API std::vector< ImageEmbedding > generateImageEmbeddings(const std::vector< Image > &images)
DAOAI_API AutoSegmentationResult inference(const ImageEmbedding &embedding, const std::vector< Point > &points)
DAOAI_API std::vector< AutoSegmentationResult > inference(const std::vector< ImageEmbedding > &embeddings, const std::vector< std::vector< Point > > &points)
DAOAI_API AutoSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API ImageEmbedding generateImageEmbeddings(const Image &image)
DAOAI_API std::vector< AutoSegmentationResult > inference(const std::vector< ImageEmbedding > &embeddings, const std::vector< std::vector< Box > > &boxes, const std::vector< std::vector< Point > > &points=std::vector< std::vector< Point > >())
DAOAI_API AutoSegmentationResult inference(const ImageEmbedding &embedding, const std::vector< Box > &boxes, const std::vector< Point > &points=std::vector< Point >())
Definition prediction.h:146
DAOAI_API std::vector< ClassificationResult > inference(const std::vector< Image > &images)
DAOAI_API ClassificationResult inference(const Image &image)
DAOAI_API Classification(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API Classification(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
Definition prediction.h:113
DAOAI_API void setIOUThreshold(const float &threshold)
DAOAI_API void setConfidenceThreshold(const float &threshold)
DAOAI_API float getConfidenceThreshold() const
DAOAI_API float getIOUThreshold() const
Definition prediction.h:134
DAOAI_API InstanceSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API InstanceSegmentation(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API std::vector< InstanceSegmentationResult > inference(const std::vector< Image > &images)
DAOAI_API InstanceSegmentationResult inference(const Image &image)
Definition prediction.h:56
DAOAI_API std::vector< KeypointDetectionResult > inference(const std::vector< Image > &images)
DAOAI_API KeypointDetection(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API KeypointDetectionResult inference(const Image &image)
DAOAI_API KeypointDetection(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
Definition prediction.h:75
DAOAI_API OCRResult inference(const Image &image)
DAOAI_API OCR(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API std::vector< OCRResult > inference(const std::vector< Image > &images)
DAOAI_API OCR(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
Definition prediction.h:97
DAOAI_API ObjectDetection(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API ObjectDetectionResult inference(const Image &image)
DAOAI_API std::vector< ObjectDetectionResult > inference(const std::vector< Image > &images)
DAOAI_API ObjectDetection(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
Definition prediction.h:37
DAOAI_API Positioning(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API Positioning(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API std::vector< PositioningResult > inference(const std::vector< Image > &images)
DAOAI_API PositioningResult inference(const Image &image)
Definition prediction.h:177
DAOAI_API PresenceChecking(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API PresenceChecking(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API PresenceCheckingResult inference(const Image &image)
DAOAI_API std::vector< PresenceCheckingResult > inference(const std::vector< Image > &images)
Definition prediction.h:194
DAOAI_API std::vector< SupervisedDefectSegmentationResult > inference(const std::vector< Image > &images)
DAOAI_API SupervisedDefectSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API SupervisedDefectSegmentation(const std::filesystem::path &model_config_path, const std::filesystem::path &model_weights_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API SupervisedDefectSegmentationResult inference(const Image &image)
Definition prediction.h:159
DAOAI_API void addComponentMemory(const std::string &component_name, const ComponentMemory &component_memory)
Add a component memory to the component memory list.
DAOAI_API size_t getBatchSize() const
DAOAI_API UnsupervisedDefectSegmentationResult inference(const Image &image, const std::string &component_name, float sensitivity)
Inference function for unsupervised defect segmentation.
DAOAI_API void removeComponentMemory(const std::string &component_name)
Remove a component memory from the component memory list.
DAOAI_API std::vector< UnsupervisedDefectSegmentationResult > inference(const std::vector< Image > &images)
DAOAI_API UnsupervisedDefectSegmentation(const DeviceType &device)
Constructor.
DAOAI_API void addComponentMemory(const std::string &component_name, const std::filesystem::path &component_memory_file_path)
Add a component memory to the component memory list.
DAOAI_API void setBatchSize(const size_t &batch_size)
DAOAI_API ~UnsupervisedDefectSegmentation()
Destructor.
DAOAI_API void setDetectionLevel(const DetectionLevel &value)
Set the detection level for the base model, whether image-level or pixel-level.
DAOAI_API UnsupervisedDefectSegmentationResult inference(const Image &image)
DAOAI_API std::unordered_map< std::string, ComponentMemory > listComponentMemory()
Get the list of component memory objects.
DAOAI_API void addComponentArchive(const std::string &archive_path)
Add a component memory archive to the component memory list.
DAOAI_API std::vector< UnsupervisedDefectSegmentationResult > inference(const std::vector< Image > &images, const std::vector< std::string > &component_names, const std::vector< float > &sensitivities)
Inference function for unsupervised defect segmentation.
DAOAI_API ComponentMemory createComponentMemory(const std::string &component_name, const std::vector< Image > &good_images, const std::vector< Image > &bad_images={}, const std::vector< Image > &masks={}, const bool &append_memory=false)
Train a component memory.
Definition prediction.h:206
DAOAI_API int getNumCUDADevices()
DeviceType
Definition common.h:18
ModelType
Definition model.h:19
@ Unsupervised_Defect_Segmentation
@ Supervised_Defect_Segmentation
DAOAI_API void clearGPUMemory()
DAOAI_API void initialize(const bool &use_shared_memory=false, const size_t &reserved_vram_size=500000000)
DetectionLevel
Definition common.h:23
std::vector< std::string > keypoint_labels
Definition model.h:44
std::string extra_infos
Definition model.h:45
std::vector< std::string > class_labels
Definition model.h:42
std::vector< int > num_keypoints
Definition model.h:43
ModelType model_type
Definition model.h:40
DeviceType device
Definition model.h:41