eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EasyDeepLearning::EClassifier Class Reference

EClassifier allows to train a classifier using an EDataset object and classify new images. More...

#include <eVision/EasyDeepLearning/EasyClassify/EClassifier.h>

Inheritance diagram for eVision::EasyDeepLearning::EClassifier:
Collaboration diagram for eVision::EasyDeepLearning::EClassifier:

Public Member Functions

 EClassifier ()
 Constructs a EClassifier object.
 EClassifier (const eVision::EasyDeepLearning::EClassifier &other)
 Copy constructor of a EClassifier object.
virtual ~EClassifier () throw ()
eVision::EasyDeepLearning::EClassifier & operator= (const eVision::EasyDeepLearning::EClassifier &other)
 Assignment operator.
virtual void SerializeSettings (eVision::ESerializer *serializer)
 Serializes the classifier settings.
virtual eVision::EasyDeepLearning::EDeepLearningToolType GetToolType () const
 Type of the deep learning tool.
void LoadAsPretrained (const std::string &path)
 Loads the classifier and use it as a pre-trained model.
void LoadOnnxModelAsPretrained (const std::string &path)
 Loads the ONNX model as a pre-trained model.
void LoadOnnxModel (const std::string &path)
 Loads the ONNX model for inference.
void SetUsePretrainedModel (bool usePretrainedModel)
 Whether to use a pre-trained model when training.
bool GetUsePretrainedModel () const
 Whether to use a pre-trained model when training.
bool HasPretrainedModel () const
 Whether a pre-trained model for the current configuration can be found.
void SetWidth (uint32_t width)
 Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
uint32_t GetWidth () const
 Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
void SetHeight (uint32_t height)
 Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
uint32_t GetHeight () const
 Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
void SetChannels (uint32_t channel)
 Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.
uint32_t GetChannels () const
 Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.
void SetEnableAutomaticImageReformat (bool val)
 Enable automatic image reformat (true by default).
bool GetEnableAutomaticImageReformat () const
 Enable automatic image reformat (true by default).
void SetEnableHistogramEqualization (bool val)
 Enable histogram equalization of all images passing through the classifier. (false by default).
bool GetEnableHistogramEqualization () const
 Enable histogram equalization of all images passing through the classifier. (false by default).
uint32_t GetMinimumWidth () const
 Minimum width for input images of the classifier. This value is equal to 1 for standard networks.
uint32_t GetMinimumHeight () const
 Minimum height for input images of the classifier. This value is equal to 1 for standard networks.
void SetCapacity (eVision::EasyDeepLearning::EClassifierCapacity capacity)
 Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).
eVision::EasyDeepLearning::EClassifierCapacity GetCapacity () const
 Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).
std::string GetModelType () const
 Model type for training. Default: "Normal".
void SetModelType (const std::string &name)
 Model type for training. Default: "Normal".
eVision::EasyDeepLearning::EClassificationMetrics GetTrainingMetrics (int id)
 Gets the metrics obtained with the training dataset at the given iteration.
eVision::EasyDeepLearning::EClassificationMetrics GetValidationMetrics (int id)
 Gets the metrics obtained with the validation dataset at the given iteration.
void Train (eVision::EasyDeepLearning::EDataset &dataset)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &dataset, const eVision::EasyDeepLearning::EDataAugmentation &dataAugmentation)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &trainingDataset, eVision::EasyDeepLearning::EDataset &validationDataset)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &trainingDataset, eVision::EasyDeepLearning::EDataset &validationDataset, const eVision::EasyDeepLearning::EDataAugmentation &dataAugmentation)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &dataset, int iterations)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &dataset, const eVision::EasyDeepLearning::EDataAugmentation &dataAugmentation, int iterations)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &trainingDataset, eVision::EasyDeepLearning::EDataset &validationDataset, int iterations)
 Trains the EClassifier with the given dataset for the specified number of iterations.
void Train (eVision::EasyDeepLearning::EDataset &trainingDataset, eVision::EasyDeepLearning::EDataset &validationDataset, const eVision::EasyDeepLearning::EDataAugmentation &dataAugmentation, int iterations)
 Trains the EClassifier with the given dataset for the specified number of iterations.
eVision::EasyDeepLearning::EClassificationResult Classify (const eVision::EBaseROI &img) const
 Classifies images and returns the complete results as an EClassificationResult object.
eVision::EasyDeepLearning::EClassificationResult Classify (const eVision::EBaseROI &img, eVision::ERegion &mask) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< const eVision::EBaseROI * > &imgList, eVision::ERegion &mask) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< const eVision::EBaseROI * > &imgList) const
 Classifies images and returns the complete results as an EClassificationResult object.
eVision::EasyDeepLearning::EClassificationResult Classify (const eVision::EBaseROI &img, eVision::ERegion &mask, const eVision::EFrame &frame) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< const eVision::EBaseROI * > &imgList, eVision::ERegion &mask, const eVision::EFrame &frame) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageBW8 > &imgList, eVision::ERegion &mask) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageBW8 > &imgList) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageBW16 > &imgList, eVision::ERegion &mask) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageBW16 > &imgList) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageC24 > &imgList, eVision::ERegion &mask) const
 Classifies images and returns the complete results as an EClassificationResult object.
std::vector< eVision::EasyDeepLearning::EClassificationResult > Classify (std::vector< eVision::EImageC24 > &imgList) const
 Classifies images and returns the complete results as an EClassificationResult object.
eVision::EasyDeepLearning::EClassificationMetrics Evaluate (const eVision::EasyDeepLearning::EDataset &dataset)
 Evaluates the EClassifier using the given EDataset.
eVision::EImageBW8 GetHeatMap (const eVision::EBaseROI &image, const std::string &label)
 Gets a heatmap associated with the given label. A heatmap is an image that indicates which pixels in the original image best explain the given label.
eVision::EImageC24 GetColorizedHeatMap (const eVision::EBaseROI &image, const std::string &label)
 Gets a colorized heatmap associated with the given label. A heatmap is an image that indicates which pixels in the original image best explain the given label.
eVision::EImageC24A GetColorizedHeatmapWithTransparency (const eVision::EBaseROI &image, const std::string &label, float minAlpha, float maxAlpha, eVision::EasyDeepLearning::EHeatmapColormap colormap)
 Colorized heatmap with transparency.
eVision::EImageC24A GetColorizedHeatmapWithTransparency (const eVision::EBaseROI &image, const std::string &label, float minAlpha, float maxAlpha)
 Colorized heatmap with transparency.
float GetOODThreshold () const
 Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.
void SetOODThreshold (float value)
 Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.
void LearnOODParameters (const eVision::EasyDeepLearning::EDataset &trainList, const eVision::EasyDeepLearning::EDataset &valList)
 Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.
void LearnOODParameters (const std::vector< const eVision::EBaseROI * > &trainList, const std::vector< const eVision::EBaseROI * > &valList)
 Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.
void LearnOODParameters (const std::vector< eVision::EImageBW8 > &trainList, const std::vector< eVision::EImageBW8 > &valList)
 Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.
void LearnOODParameters (const std::vector< eVision::EImageBW16 > &trainList, const std::vector< eVision::EImageBW16 > &valList)
 Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.
void LearnOODParameters (const std::vector< eVision::EImageC24 > &trainList, const std::vector< eVision::EImageC24 > &valList)
 Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.
bool HasOODParameters () const
 Checks whether the OOD parameters have been learned.
void SetComputeHeatmapWithResult (bool computeHeatmap)
 Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through EClassificationResult::GetHeatmap.
bool GetComputeHeatmapWithResult () const
 Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through EClassificationResult::GetHeatmap.
void SetComputeOODWithResult (bool computeOOD)
 Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through EClassificationResult::GetOODScore.
bool GetComputeOODWithResult () const
 Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through EClassificationResult::GetOODScore.
 EClassifier (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::EasyDeepLearning::EDeepLearningTool
virtual ~EDeepLearningTool () throw ()
virtual void Load (const std::string &filePath)
 Loads a deep learning tool. The given ESerializer must have been created for reading.
virtual void Load (eVision::ESerializer *serializer)
 Loads a deep learning tool. The given ESerializer must have been created for reading.
std::unique_ptr< eVision::EasyDeepLearning::EDeepLearningTool > Clone () const
 Clones this tool.
virtual void Save (const std::string &filePath, bool includeTrainingModel)
 Saves the settings, inference and training model of the deep learning tool.
virtual void Save (const std::string &filePath)
 Saves the settings, inference and training model of the deep learning tool.
virtual void Save (eVision::ESerializer *serializer, bool includeTrainingModel)
 Saves the settings, inference and training model of the deep learning tool.
virtual void Save (eVision::ESerializer *serializer)
 Saves the settings, inference and training model of the deep learning tool.
void SerializeInferenceModel (eVision::ESerializer *serializer)
 Serializes the inference model of the tool.
void SerializeTrainingModel (eVision::ESerializer *serializer)
 Serializes the training model of the tool.
void SaveSettings (const std::string &filePath)
 Saves the settings of the tool to a file.
void SaveInferenceModel (const std::string &filePath)
 Saves the tool's inference model to a file.
void SaveTrainingModel (const std::string &filePath)
 Saves the tool's training model to a file.
void LoadSettings (const std::string &filePath)
 Loads the settings of a tool.
void LoadInferenceModel (const std::string &filePath)
 Loads the tool's inference model. The inference model is required to apply the tool on new images.
void LoadTrainingModel (const std::string &filePath)
 Loads the tool's training model. The training model is required to continue a training.
void UnloadInferenceModel ()
 Unloads the inference model.
void UnloadTrainingModel ()
 Unloads the training model.
void UnloadModels ()
 Unloads the inference and training model.
bool HasInferenceModel () const
 Whether the inference model is loaded or created when the tool is not yet trained.
bool HasTrainingModel () const
 Whether the training model is loaded or created when the tool is not yet trained.
bool IsTrained () const
 Tells whether the deep learning tool has been trained.
void SetEnableGPU (bool enable)
 Enable the use of a GPU for training and inference of the deep learning tool. If the active engine is not the default engine, EDeepLearningTool::SetEnableGPU will be false even if the active device has a GPU device type. Setting EDeepLearningTool::SetEnableGPU to any value when the active engine is not the default one will throw an exception.
bool GetEnableGPU () const
 Enable the use of a GPU for training and inference of the deep learning tool. If the active engine is not the default engine, EDeepLearningTool::SetEnableGPU will be false even if the active device has a GPU device type. Setting EDeepLearningTool::SetEnableGPU to any value when the active engine is not the default one will throw an exception.
void SetGPUIndexes (const std::vector< uint32_t > &indexes)
 Indexes of the GPUs to use for computations.
std::vector< uint32_t > GetGPUIndexes () const
 Indexes of the GPUs to use for computations.
uint32_t GetNumGPUs () const
 Number of detected NVIDIA GPU.
void SetEngine (const std::string &engineName)
 Sets the engine with which to execute or train the neural network.
std::string GetEngine () const
 Sets the engine with which to execute or train the neural network.
eVision::EasyDeepLearning::EDeepLearningInferencePrecision GetInferencePrecision () const
 Inference precision.
void SetInferencePrecision (eVision::EasyDeepLearning::EDeepLearningInferencePrecision prec)
 Inference precision.
int GetNumAvailableDevices () const
 Available devices for the current EDeepLearningTool::SetEngine.
std::string GetAvailableDeviceName (int i) const
 Name of the i-th device of the current engine.
eVision::EasyDeepLearning::EDeepLearningDevice GetAvailableDevice (int i) const
 i-th EDeepLearningDevice of the current engine.
std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > GetAvailableDevices () const
 Get all available device for the current engine.
int GetNumActiveDevices () const
 Gets the number of devices with which to run or train the model.
void SetActiveDevice (const eVision::EasyDeepLearning::EDeepLearningDevice &device)
 Sets the device with which to run or train the model.
eVision::EasyDeepLearning::EDeepLearningDevice GetActiveDevice (int i) const
 Gets the active device. By default, it returns the first active device.
eVision::EasyDeepLearning::EDeepLearningDevice GetActiveDevice () const
 Gets the active device. By default, it returns the first active device.
void SetActiveDeviceByName (const std::string &name)
 Sets the device with which to run the model using its name.
void SetActiveDeviceById (int id)
 Sets the device with which to run the model using its index in the list returned by EDeepLearningTool::GetAvailableDevices.
std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > GetActiveDevices () const
 Devices with which to run or train the model.
void SetActiveDevices (const std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > &devices)
 Devices with which to run or train the model.
void SetActiveDevicesById (const std::vector< int > &ids)
 Sets the devices with which to run the model using their index in the list returned by EDeepLearningTool::GetAvailableDevices.
eVision::EasyDeepLearning::EDeepLearningExecutionSettings GetExecutionSettings () const
 Execution settings of the tool (engine, device(s), inference precision, batch size settings).
void SetExecutionSettings (const eVision::EasyDeepLearning::EDeepLearningExecutionSettings &settings)
 Execution settings of the tool (engine, device(s), inference precision, batch size settings).
bool HasEngineSetupData () const
 Whether the inference model has engine setup data.
void ClearEngineSetupData ()
 Clears the engine data saved in the inference model. Use this method when your engine fails.
eVision::EasyDeepLearning::EDeepLearningDevice GetEngineSetupDataDevice () const
 Device corresponding to the engine data contained in the tool.
eVision::EasyDeepLearning::EDeepLearningInferencePrecision GetEngineSetupDataInferencePrecision () const
 Inference precision corresponding to the engine data contained in the tool.
int32_t GetEngineSetupDataBatchSize () const
 Batch size corresponding to the engine data contained in the tool.
bool GetOptimizeBatchSize () const
 Indicates whether to optimize the batch size (see EDeepLearningTool::SetBatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
void SetOptimizeBatchSize (bool optimize)
 Indicates whether to optimize the batch size (see EDeepLearningTool::SetBatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
int32_t GetBatchSizeForMaximumInferenceSpeed () const
 Computes the batch size that will maximize the inference speed on NVIDIA GPU. For all other devices, it will return 1.
void SetBatchSize (int32_t size)
 Batch size. The batch size is the number of images that are processed together during training and batch inference.
int32_t GetBatchSize () const
 Batch size. The batch size is the number of images that are processed together during training and batch inference.
bool IsTraining () const
 Indicates whether the object is currently training.
int WaitForTrainingCompletion (int timeout)
 Waits until the training is complete or the timeout is expired. A call to this method will block the calling thread for the shortest time between the timeout and the time it takes for the training to complete.
int WaitForTrainingCompletion ()
 Waits until the training is complete or the timeout is expired. A call to this method will block the calling thread for the shortest time between the timeout and the time it takes for the training to complete.
int WaitForIterationCompletion ()
 Waits until an iteration is complete. A call to this method will block the calling thread until a training iteration in the training thread is finished. This method returns the number of trained iterations.
int StopTraining (bool wait)
 Stops training and returns the last completed iteration. If the parameter 'wait' is set to true, the method will wait for the training thread to completely stop. Otherwise, the method will return immediately.
float GetCurrentTrainingProgression () const
 Current training progression as a percentage (between 0 and 1).
uint32_t GetCurrentTrainingFinishedIterations () const
 Number of iterations that are already finished in the current training.
uint32_t GetCurrentTrainingNumIterations () const
 Total number of training iterations that will be performed during the current training of the deep learning tool.
uint32_t GetNumTrainedIterations () const
 Number of iterations that were performed to train this deep learning tool.
int GetBestIteration () const
 Iteration at which the minimum validation error was reached. After training, the tool is in the state it was at this best iteration.
void SetImageCacheSize (uint64_t size)
 Size in byte of the image cache. The cache is used during training to store reformatted and normalized images. A correctly sized cache can reduce the hard drive accesses and the preprocessing time for each image.
uint64_t GetImageCacheSize () const
 Size in byte of the image cache. The cache is used during training to store reformatted and normalized images. A correctly sized cache can reduce the hard drive accesses and the preprocessing time for each image.
std::string GetPath () const
 Path of the tool when loaded or saved using EDeepLearningTool::Save or EDeepLearningTool::Load.
std::string GetInferenceModelPath () const
 Path of the inference model when loaded or saved using EDeepLearningTool::SaveInferenceModel, EDeepLearningTool::LoadInferenceModel or EDeepLearningTool::SerializeInferenceModel.
std::string GetTrainingModelPath () const
 Path of the training model when loaded or saved using EDeepLearningTool::SaveTrainingModel, EDeepLearningTool::LoadTrainingModel or EDeepLearningTool::SerializeTrainingModel.
std::string GetSettingsPath () const
 Path of the settings when loaded or saved using EDeepLearningTool::SaveSettings, EDeepLearningTool::LoadSettings or EDeepLearningTool::SerializeSettings.
void SetAutoSavePeriod (int period)
 Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model.
int GetAutoSavePeriod () const
 Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model.
void SetLearningRate (eVision::EasyDeepLearning::EDeepLearningLearningRateType type, const std::vector< float > &parameters)
 Specifies how the value of the learning rate and how it evolves during training.
eVision::EasyDeepLearning::EDeepLearningLearningRateType GetLearningRateType () const
 Learning rate type.
std::vector< float > GetLearningRateParameters () const
 Parameters of the learning rate.
void SetEnableDeterministicTraining (bool enable)
 Whether to use deterministic training algorithm that allows to repeatable training results. Default value: false.
bool GetEnableDeterministicTraining () const
 Whether to use deterministic training algorithm that allows to repeatable training results. Default value: false.
void SetDeterministicTrainingRandomSeed (int32_t seed)
 Random seed to use when EDeepLearningTool::SetEnableDeterministicTraining is set to true. The default value is 42.
int32_t GetDeterministicTrainingRandomSeed () const
 Random seed to use when EDeepLearningTool::SetEnableDeterministicTraining is set to true. The default value is 42.
void InitializeInference (int width, int height, eVision::EImageType imageType, int numImages)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
void InitializeInference (const eVision::EBaseROI &img)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
void InitializeInference (std::vector< const eVision::EBaseROI * > &imgList)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
void InitializeInference (std::vector< eVision::EImageBW8 > &imgList)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
void InitializeInference (std::vector< eVision::EImageBW16 > &imgList)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
void InitializeInference (std::vector< eVision::EImageC24 > &imgList)
 Initializes the neural network for inference (i.e. making predictions with the neural network).
uint32_t GetNumLabels () const
 Number of labels of this tool. If the tool is not trained, the method will throw an exception.
std::string GetLabel (uint32_t index) const
 Gets the label from its index. If the tool is not trained, the method may throw an exception.
virtual void SetLabel (uint32_t index, const std::string &label)
 Changes a label predicted by the tool.
void SetLabelWeight (uint32_t index, float weight)
 Sets the label weight. If the tool is not trained, the label weights are not defined. After training, they are set to the value of the training dataset label weights.
float GetLabelWeight (uint32_t index) const
 Gets the label weight. If the tool is not trained, the label weights are not defined. After training, they are set to the value of the training dataset label weights.
void SetLabelColor (uint32_t index, const eVision::ERGBColor &c)
 Changes a label color.
eVision::ERGBColor GetLabelColor (uint32_t index) const
 Label color. The label colors affect how the results will be displayed.
void SetLabelOpacity (uint32_t index, uint8_t opacity)
 Changes a label opacity (between 0 for fully transparent and 255 for opaque color).
uint8_t GetLabelOpacity (uint32_t index) const
 Gets the label opacity (between 0 for fully transparent and 255 for opaque color). The label opacities affect with the label colors how the results will be displayed.
int GetOptimalNumImagesForBatchSize (const eVision::EBaseROI &sampleImage) const
 Optimal number of images to process together for inference given the batch size and EDeepLearningTool::GetNumPatchesForImage.
int GetOptimalNumImagesForBatchSize (int imageWidth, int imageHeight) const
 Optimal number of images to process together for inference given the batch size and EDeepLearningTool::GetNumPatchesForImage.
int GetNumPatchesForImage (const eVision::EBaseROI &sampleImage) const
 Number of patches that will be extracted from an input image to perform inference.
virtual int GetNumPatchesForImage (int imageWidth, int imageHeight) const
 Number of patches that will be extracted from an input image to perform inference.
virtual void Clean ()
 Reset the engine and clean CPU and GPU memory allocated for running the model.
 EDeepLearningTool (CppWrapperInternal::InternalConstructor)

Static Public Member Functions

static std::string GetAvailableModelTypes (int i)
 Get the i-th available models to be used with EClassifier::GetModelType.
static int GetNumAvailableModelTypes ()
 Number of available models for training an EasyClassify tool.
Static Public Member Functions inherited from eVision::EasyDeepLearning::EDeepLearningTool
static std::unique_ptr< eVision::EasyDeepLearning::EDeepLearningTool > Create (const std::string &path)
 Factory method to open a deep learning tool.
static std::unique_ptr< eVision::EasyDeepLearning::EDeepLearningTool > Create (eVision::ESerializer *serializer)
 Factory method to open a deep learning tool.
static std::unique_ptr< eVision::EasyDeepLearning::EDeepLearningTool > Create (eVision::EasyDeepLearning::EDeepLearningToolType type)
 Factory method to open a deep learning tool.
static int GetNumAvailableEngines ()
 Number of available engines.
static std::string GetAvailableEngineName (int id)
 Gets the name of the engine given its id.
static std::vector< std::string > GetAvailableEngines ()
 Available engines.
static std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > GetAvailableDevicesForEngine (const std::string &engine)
 Available devices for the specified engine.

Additional Inherited Members

Public Attributes inherited from eVision::EasyDeepLearning::EDeepLearningTool
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

EClassifier allows to train a classifier using an EDataset object and classify new images.

As required by Deep Learning techniques, the input image of EClassifier must be of the same format (width, height, number of channels). By default, this format will be 224x224xC (which is the format used for pre-training our networks) with C being the number of channel of the first image of the dataset. The format can also be specified by the EClassifier::SetWidth, EClassifier::SetHeight and EClassifier::SetChannels unless its width and height is smaller than the minimum width and height supported by the classifier. In this case, the input resolution will be the minimum resolution supported by the classifier. (See EClassifier::GetMinimumWidth and EClassifier::GetMinimumHeight). methods.

By default, images that don't satisfy the image format of the classifier are automatically reformatted. This behavior can be controlled through the EClassifier::SetEnableAutomaticImageReformat method. When the automatic image reformatting is disabled, training or classifying an image that doesn't satisfy the input image format will result in an exception.

Once trained, the input image format cannot be changed.

License(s): EasyClassify or EasyClassifyInference

Constructor & Destructor Documentation

◆ EClassifier() [1/3]

eVision::EasyDeepLearning::EClassifier::EClassifier ( )

Constructs a EClassifier object.

◆ EClassifier() [2/3]

eVision::EasyDeepLearning::EClassifier::EClassifier ( const eVision::EasyDeepLearning::EClassifier & other)

Copy constructor of a EClassifier object.

Parameters
otherReference to the EClassifier object that should be copied

◆ ~EClassifier()

eVision::EasyDeepLearning::EClassifier::~EClassifier ( )
throw ( )
virtual

◆ EClassifier() [3/3]

eVision::EasyDeepLearning::EClassifier::EClassifier ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ Classify() [1/12]

eVision::EasyDeepLearning::EClassificationResult eVision::EasyDeepLearning::EClassifier::Classify ( const eVision::EBaseROI & img) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgImage to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [2/12]

eVision::EasyDeepLearning::EClassificationResult eVision::EasyDeepLearning::EClassifier::Classify ( const eVision::EBaseROI & img,
eVision::ERegion & mask ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgImage to classify
maskMask of image to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [3/12]

eVision::EasyDeepLearning::EClassificationResult eVision::EasyDeepLearning::EClassifier::Classify ( const eVision::EBaseROI & img,
eVision::ERegion & mask,
const eVision::EFrame & frame ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgImage to classify
maskMask of image to classify
frameFrame associated with the mask.

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [4/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< const eVision::EBaseROI * > & imgList) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [5/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< const eVision::EBaseROI * > & imgList,
eVision::ERegion & mask ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify
maskMask of image to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [6/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< const eVision::EBaseROI * > & imgList,
eVision::ERegion & mask,
const eVision::EFrame & frame ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify
maskMask of image to classify
frameFrame associated with the mask.

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [7/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageBW16 > & imgList) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [8/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageBW16 > & imgList,
eVision::ERegion & mask ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify
maskMask of image to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [9/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageBW8 > & imgList) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [10/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageBW8 > & imgList,
eVision::ERegion & mask ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify
maskMask of image to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [11/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageC24 > & imgList) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Classify() [12/12]

std::vector< eVision::EasyDeepLearning::EClassificationResult > eVision::EasyDeepLearning::EClassifier::Classify ( std::vector< eVision::EImageC24 > & imgList,
eVision::ERegion & mask ) const

Classifies images and returns the complete results as an EClassificationResult object.

The method throws an exception if the input image does not fulfill the input specification.

Parameters
imgListVector of images to classify
maskMask of image to classify

Classifying a set of images is usually faster than classifying each image sequentially.

To maximize the classification speed on a GPU, EDeepLearningTool::SetBatchSize and the size of the set of input images must be equal to the value returned by EDeepLearningTool::GetBatchSizeForMaximumInferenceSpeed.

◆ Evaluate()

eVision::EasyDeepLearning::EClassificationMetrics eVision::EasyDeepLearning::EClassifier::Evaluate ( const eVision::EasyDeepLearning::EDataset & dataset)

Evaluates the EClassifier using the given EDataset.

Parameters
datasetEDataset with which to evaluate the classifier

This method computes various metrics (see EClassificationMetrics on the given dataset.

The method ignores the label weights and the data augmentation settings of the given dataset. However, the label weights can be taken into consideration in the returned EClassificationMetrics object.

License(s): EasyClassify

◆ GetAvailableModelTypes()

std::string eVision::EasyDeepLearning::EClassifier::GetAvailableModelTypes ( int i)
static

Get the i-th available models to be used with EClassifier::GetModelType.

Parameters
iIndex of the model between 0 and EClassifier::GetNumAvailableModelTypes - 1.

◆ GetCapacity()

eVision::EasyDeepLearning::EClassifierCapacity eVision::EasyDeepLearning::EClassifier::GetCapacity ( ) const

Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).

Deprecated
Deprecated in version 22.12. Scheduled to be removed in version 27.6.

◆ GetChannels()

uint32_t eVision::EasyDeepLearning::EClassifier::GetChannels ( ) const

Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ GetColorizedHeatMap()

eVision::EImageC24 eVision::EasyDeepLearning::EClassifier::GetColorizedHeatMap ( const eVision::EBaseROI & image,
const std::string & label )

Gets a colorized heatmap associated with the given label. A heatmap is an image that indicates which pixels in the original image best explain the given label.

Parameters
imageA reference to the image we want to generate the heatmap from.
labelA reference to the string representing the label we want to explain for the given image.

◆ GetColorizedHeatmapWithTransparency() [1/2]

eVision::EImageC24A eVision::EasyDeepLearning::EClassifier::GetColorizedHeatmapWithTransparency ( const eVision::EBaseROI & image,
const std::string & label,
float minAlpha,
float maxAlpha )

Colorized heatmap with transparency.

When the minimum and maximum alpha values are different from each other, the transparency value for a pixel will depend on the value of the heatmap at that pixel. The range of heatmap values [0, 255] will be mapped to the range [minAlpha, maxAlpha].

Parameters
imageA reference to the image we want to generate the heatmap from.
labelA reference to the string representing the label we want to explain for the given image.
minAlphaMinimum transparency value.
maxAlphaMaximum transparency value.

◆ GetColorizedHeatmapWithTransparency() [2/2]

eVision::EImageC24A eVision::EasyDeepLearning::EClassifier::GetColorizedHeatmapWithTransparency ( const eVision::EBaseROI & image,
const std::string & label,
float minAlpha,
float maxAlpha,
eVision::EasyDeepLearning::EHeatmapColormap colormap )

Colorized heatmap with transparency.

When the minimum and maximum alpha values are different from each other, the transparency value for a pixel will depend on the value of the heatmap at that pixel. The range of heatmap values [0, 255] will be mapped to the range [minAlpha, maxAlpha].

Parameters
imageA reference to the image we want to generate the heatmap from.
labelA reference to the string representing the label we want to explain for the given image.
minAlphaMinimum transparency value.
maxAlphaMaximum transparency value.
colormapColor map

◆ GetComputeHeatmapWithResult()

bool eVision::EasyDeepLearning::EClassifier::GetComputeHeatmapWithResult ( ) const

Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through EClassificationResult::GetHeatmap.

◆ GetComputeOODWithResult()

bool eVision::EasyDeepLearning::EClassifier::GetComputeOODWithResult ( ) const

Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through EClassificationResult::GetOODScore.

◆ GetEnableAutomaticImageReformat()

bool eVision::EasyDeepLearning::EClassifier::GetEnableAutomaticImageReformat ( ) const

Enable automatic image reformat (true by default).

◆ GetEnableHistogramEqualization()

bool eVision::EasyDeepLearning::EClassifier::GetEnableHistogramEqualization ( ) const

Enable histogram equalization of all images passing through the classifier. (false by default).

◆ GetHeatMap()

eVision::EImageBW8 eVision::EasyDeepLearning::EClassifier::GetHeatMap ( const eVision::EBaseROI & image,
const std::string & label )

Gets a heatmap associated with the given label. A heatmap is an image that indicates which pixels in the original image best explain the given label.

Parameters
imageA reference to the image we want to generate the heatmap from.
labelA reference to the string representing the label we want to explain for the given image.

◆ GetHeight()

uint32_t eVision::EasyDeepLearning::EClassifier::GetHeight ( ) const

Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ GetMinimumHeight()

uint32_t eVision::EasyDeepLearning::EClassifier::GetMinimumHeight ( ) const

Minimum height for input images of the classifier. This value is equal to 1 for standard networks.

◆ GetMinimumWidth()

uint32_t eVision::EasyDeepLearning::EClassifier::GetMinimumWidth ( ) const

Minimum width for input images of the classifier. This value is equal to 1 for standard networks.

◆ GetModelType()

std::string eVision::EasyDeepLearning::EClassifier::GetModelType ( ) const

Model type for training. Default: "Normal".

The list of available models is available through EClassifier::GetAvailableModelTypes.

◆ GetNumAvailableModelTypes()

int eVision::EasyDeepLearning::EClassifier::GetNumAvailableModelTypes ( )
static

Number of available models for training an EasyClassify tool.

◆ GetOODThreshold()

float eVision::EasyDeepLearning::EClassifier::GetOODThreshold ( ) const

Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.

If training has been carried out with EClassifier::SetComputeOODWithResult set to True, the parameters have been automatically initialized. Otherwise, call EClassifier::LearnOODParameters with the training data before calling this method.

The OOD threshold is automatically initialized during learning. If needed, the parameter can also be changed manually.

◆ GetToolType()

eVision::EasyDeepLearning::EDeepLearningToolType eVision::EasyDeepLearning::EClassifier::GetToolType ( ) const
virtual

Type of the deep learning tool.

Implements eVision::EasyDeepLearning::EDeepLearningTool.

◆ GetTrainingMetrics()

eVision::EasyDeepLearning::EClassificationMetrics eVision::EasyDeepLearning::EClassifier::GetTrainingMetrics ( int id)

Gets the metrics obtained with the training dataset at the given iteration.

The iterations are indexed between 0 and EDeepLearningTool::GetNumTrainedIterations - 1.

Parameters
idThe iteration index

◆ GetUsePretrainedModel()

bool eVision::EasyDeepLearning::EClassifier::GetUsePretrainedModel ( ) const

Whether to use a pre-trained model when training.

Default: true if the pre-trained model are found on the disk.

◆ GetValidationMetrics()

eVision::EasyDeepLearning::EClassificationMetrics eVision::EasyDeepLearning::EClassifier::GetValidationMetrics ( int id)

Gets the metrics obtained with the validation dataset at the given iteration.

The iterations are indexed between 0 and EDeepLearningTool::GetNumTrainedIterations - 1.

Parameters
idThe iteration index

◆ GetWidth()

uint32_t eVision::EasyDeepLearning::EClassifier::GetWidth ( ) const

Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ HasOODParameters()

bool eVision::EasyDeepLearning::EClassifier::HasOODParameters ( ) const

Checks whether the OOD parameters have been learned.

◆ HasPretrainedModel()

bool eVision::EasyDeepLearning::EClassifier::HasPretrainedModel ( ) const

Whether a pre-trained model for the current configuration can be found.

◆ LearnOODParameters() [1/5]

void eVision::EasyDeepLearning::EClassifier::LearnOODParameters ( const eVision::EasyDeepLearning::EDataset & trainList,
const eVision::EasyDeepLearning::EDataset & valList )

Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.

Parameters
trainListList of images used for training the EClassifier.
valListList of images used as validation during the training of the EClassifier.

◆ LearnOODParameters() [2/5]

void eVision::EasyDeepLearning::EClassifier::LearnOODParameters ( const std::vector< const eVision::EBaseROI * > & trainList,
const std::vector< const eVision::EBaseROI * > & valList )

Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.

Parameters
trainListList of images used for training the EClassifier.
valListList of images used as validation during the training of the EClassifier.

◆ LearnOODParameters() [3/5]

void eVision::EasyDeepLearning::EClassifier::LearnOODParameters ( const std::vector< eVision::EImageBW16 > & trainList,
const std::vector< eVision::EImageBW16 > & valList )

Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.

Parameters
trainListList of images used for training the EClassifier.
valListList of images used as validation during the training of the EClassifier.

◆ LearnOODParameters() [4/5]

void eVision::EasyDeepLearning::EClassifier::LearnOODParameters ( const std::vector< eVision::EImageBW8 > & trainList,
const std::vector< eVision::EImageBW8 > & valList )

Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.

Parameters
trainListList of images used for training the EClassifier.
valListList of images used as validation during the training of the EClassifier.

◆ LearnOODParameters() [5/5]

void eVision::EasyDeepLearning::EClassifier::LearnOODParameters ( const std::vector< eVision::EImageC24 > & trainList,
const std::vector< eVision::EImageC24 > & valList )

Learns OOD parameters using training data. The dataset must correspond to the dataset used to train the classifier.

Parameters
trainListList of images used for training the EClassifier.
valListList of images used as validation during the training of the EClassifier.

◆ LoadAsPretrained()

void eVision::EasyDeepLearning::EClassifier::LoadAsPretrained ( const std::string & path)

Loads the classifier and use it as a pre-trained model.

Parameters
pathPath to the pre-trained model.

◆ LoadOnnxModel()

void eVision::EasyDeepLearning::EClassifier::LoadOnnxModel ( const std::string & path)

Loads the ONNX model for inference.

The methods will automatically create labels according to the number of classes in the ONNX model. The labels are named according to their position, i.e. "0", "1", etc. You can change the labels afterward using the method EDeepLearningTool::SetLabel.

◆ LoadOnnxModelAsPretrained()

void eVision::EasyDeepLearning::EClassifier::LoadOnnxModelAsPretrained ( const std::string & path)

Loads the ONNX model as a pre-trained model.

This method loads the architecture of the neural network as well as the trained weights in the model but discards the weights and parameters of some of the last layers to allow retraining on a new dataset with a different number of labels.

◆ operator=()

eVision::EasyDeepLearning::EClassifier & eVision::EasyDeepLearning::EClassifier::operator= ( const eVision::EasyDeepLearning::EClassifier & other)

Assignment operator.

Parameters
otherReference to the EClassifier object used for the assignment

◆ SerializeSettings()

void eVision::EasyDeepLearning::EClassifier::SerializeSettings ( eVision::ESerializer * serializer)
virtual

Serializes the classifier settings.

Parameters
serializerPointer to ESerializer

Implements eVision::EasyDeepLearning::EDeepLearningTool.

◆ SetCapacity()

void eVision::EasyDeepLearning::EClassifier::SetCapacity ( eVision::EasyDeepLearning::EClassifierCapacity capacity)

Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).

Parameters
capacityCapacity of classifier
Deprecated

Use EClassifier::GetModelType instead.

Deprecated in version 22.12. Scheduled to be removed in version 27.6.

◆ SetChannels()

void eVision::EasyDeepLearning::EClassifier::SetChannels ( uint32_t channel)

Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ SetComputeHeatmapWithResult()

void eVision::EasyDeepLearning::EClassifier::SetComputeHeatmapWithResult ( bool computeHeatmap)

Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through EClassificationResult::GetHeatmap.

Parameters
computeHeatmapWhether to compute the heatmap with the result

◆ SetComputeOODWithResult()

void eVision::EasyDeepLearning::EClassifier::SetComputeOODWithResult ( bool computeOOD)

Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through EClassificationResult::GetOODScore.

Parameters
computeOODWhether to compute the OOD score with the result.

◆ SetEnableAutomaticImageReformat()

void eVision::EasyDeepLearning::EClassifier::SetEnableAutomaticImageReformat ( bool val)

Enable automatic image reformat (true by default).

◆ SetEnableHistogramEqualization()

void eVision::EasyDeepLearning::EClassifier::SetEnableHistogramEqualization ( bool val)

Enable histogram equalization of all images passing through the classifier. (false by default).

◆ SetHeight()

void eVision::EasyDeepLearning::EClassifier::SetHeight ( uint32_t height)

Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ SetModelType()

void eVision::EasyDeepLearning::EClassifier::SetModelType ( const std::string & name)

Model type for training. Default: "Normal".

The list of available models is available through EClassifier::GetAvailableModelTypes.

◆ SetOODThreshold()

void eVision::EasyDeepLearning::EClassifier::SetOODThreshold ( float value)

Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.

If training has been carried out with EClassifier::SetComputeOODWithResult set to True, the parameters have been automatically initialized. Otherwise, call EClassifier::LearnOODParameters with the training data before calling this method.

The OOD threshold is automatically initialized during learning. If needed, the parameter can also be changed manually.

◆ SetUsePretrainedModel()

void eVision::EasyDeepLearning::EClassifier::SetUsePretrainedModel ( bool usePretrainedModel)

Whether to use a pre-trained model when training.

Default: true if the pre-trained model are found on the disk.

◆ SetWidth()

void eVision::EasyDeepLearning::EClassifier::SetWidth ( uint32_t width)

Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.

If the classifier is not trained or the value was not explicitly set, its value will be 0.

◆ Train() [1/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & dataset)

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
datasetEDataset with which to train and validate the deep learning tool

License(s): EasyClassify

◆ Train() [2/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & dataset,
const eVision::EasyDeepLearning::EDataAugmentation & dataAugmentation )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
datasetEDataset with which to train and validate the deep learning tool
dataAugmentationData augmentation to use during training

License(s): EasyClassify

◆ Train() [3/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & dataset,
const eVision::EasyDeepLearning::EDataAugmentation & dataAugmentation,
int iterations )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
datasetEDataset with which to train and validate the deep learning tool
dataAugmentationData augmentation to use during training
iterationsNumber of iterations for training.

License(s): EasyClassify

◆ Train() [4/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & dataset,
int iterations )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
datasetEDataset with which to train and validate the deep learning tool
iterationsNumber of iterations for training.

License(s): EasyClassify

◆ Train() [5/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & trainingDataset,
eVision::EasyDeepLearning::EDataset & validationDataset )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
trainingDatasetEDataset with which to train the deep learning tool
validationDatasetEDataset with which to validate the deep learning tool

License(s): EasyClassify

◆ Train() [6/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & trainingDataset,
eVision::EasyDeepLearning::EDataset & validationDataset,
const eVision::EasyDeepLearning::EDataAugmentation & dataAugmentation )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
trainingDatasetEDataset with which to train the deep learning tool
validationDatasetEDataset with which to validate the deep learning tool
dataAugmentationData augmentation to use during training

License(s): EasyClassify

◆ Train() [7/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & trainingDataset,
eVision::EasyDeepLearning::EDataset & validationDataset,
const eVision::EasyDeepLearning::EDataAugmentation & dataAugmentation,
int iterations )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
trainingDatasetEDataset with which to train the deep learning tool
validationDatasetEDataset with which to validate the deep learning tool
dataAugmentationData augmentation to use during training
iterationsNumber of iterations for training.

License(s): EasyClassify

◆ Train() [8/8]

void eVision::EasyDeepLearning::EClassifier::Train ( eVision::EasyDeepLearning::EDataset & trainingDataset,
eVision::EasyDeepLearning::EDataset & validationDataset,
int iterations )

Trains the EClassifier with the given dataset for the specified number of iterations.

At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See EDeepLearningTool::GetBestIteration.

If no iterations is given, the training will stop automatically.

Parameters
trainingDatasetEDataset with which to train the deep learning tool
validationDatasetEDataset with which to validate the deep learning tool
iterationsNumber of iterations for training.

License(s): EasyClassify