EDeepLearningTool Class

EDeepLearningTool represents the common operations of deep learning tools.

The class is responsible for handling CPU/GPU settings and training.
Computing the result for an image is called inference and is the responsability of the actual deep learning tools (see EClassifier).

Derived Class(es):EClassifierELocatorBaseESupervisedSegmenterEUnsupervisedSegmenter

Namespace: Euresys::Open_eVision::EasyDeepLearning

Methods

Factory method to open a deep learning tool.
Returns the corresponding deep learning tool that must be deleted by the caller.
Gets the active device. By default, it returns the first active device.
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model.
In order for the model to be automatically saved during the training, the tool must have been loaded or saved to a file. The path where the tool will be saved is either indicated by EDeepLearningTool::Path or the three paths EDeepLearningTool::SettingsPath, EDeepLearningTool::InferenceModelPath, and EDeepLearningTool::TrainingModelPath. If one of these path is empty, the corresponding part of the tool will not be saved automatically during training.
By default, auto save is disabled and the period is equal to 0.
Name of the i-th device of the current engine.
Get all available device for the current engine.
Available devices for the specified engine.
Gets the name of the engine given its id.
Available engines.
Batch size. The batch size is the number of images that are processed together during training and batch inference.
When using multi-GPUs processing (see EDeepLearningTool::GPUIndexes), the batch size is the number of images that each GPU will process at once.
A large batch size will increase the processing speed on GPU but also the memory requirements.
The batch size must be bigger or equal to 1 and it is commonly chosen to be a power of 2.
Computes the batch size that will maximize the inference speed on NVIDIA GPU. For all other devices, it will return 1.
Iteration at which the minimum validation error was reached. After training, the tool is in the state it was at this best iteration.
Number of iterations that are already finished in the current training.
Total number of training iterations that will be performed during the current training of the deep learning tool.
After the end of the training, this number is the actual number of iterations performed during the training which can be lower than the number of iterations given to the EDeepLearningTool::Train method (for example if the user called EDeepLearningTool::StopTraining).
Current training progression as a percentage (between 0 and 1).
Random seed to use when EDeepLearningTool::EnableDeterministicTraining is set to true. The default value is 42.
When EDeepLearningTool::EnableDeterministicTraining, the random seed is generated using a random non-deterministic source.
Whether to use determinitic training algorithm that allows to repeatable training results. Default value: false.
Deprecated: Use EDeepLearningTool.
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::EnableGPU will be false even if the active device has a GPU device type. Setting EDeepLearningTool::EnableGPU to any value when the active engine is not the default one will throw an exception.
Sets the engine with which to execute or train the neural network.
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
Deprecated: use EDeepLearningTool or EDeepLearningTool::ActiveDevices.
Indexes of the GPUs to use for computations.
Using multiple GPUs is only possible when we can process multiple images at once, i.e. during training (EDeepLearningTool::Train) or batch inference.
By default, all the detected GPUs will be used.
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.
Inference precision.
Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.
Gets the label from its index. If the tool is not trained, the method may throw an exception.
Label color. The label colors affect how the results will be displayed.
The default label colors are the one specified in the dataset used for training.
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.
The default label opacities are the one specified in the dataset used for training.
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.
Gets the number of devices with which to run or train the model.
Available devices for the current EDeepLearningTool::Engine.
Number of available engines.
Deprecated: use EDeepLearningTool with a device type of GPU.
Number of detected NVIDIA GPU.
Number of labels of this tool. If the tool is not trained, the method will throw an exception.
Number of patches that will be extracted from an input image to perform inference.
For EasyClassify and EasyLocate, this will always be equal to 1.
For EasySegment, the number of patches will depend on the scale, patch size and sampling density parameters.
Number of iterations that were performed to train this deep learning tool.
Optimal number of images to process together for inference given the batch size and EDeepLearningTool::GetNumPatchesForImage.
In practice, for EasyClassify and EasyLocate, this is the same as the batch size.
For EasySegment, the value will depend on the scale, patch size and sampling density parameters.
Indicates whether to optimize the batch size (see EDeepLearningTool::BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
Default value is true.
Path of the tool when loaded or saved using EDeepLearningTool::Save, EDeepLearningTool::Load or EDeepLearningTool.
Type of the deep learning tool.
Whether the inference model is loaded or created when the tool is not yet trained.
Whether the training model is loaded or created when the tool is not yet trained.
Initializes the neural network for inference (i.e. making predictions with the neural network).
You need to pass an image or a vector of images with the same characteristics (image resolution, image type and number of image) as the image or vector of images that you will use to make inference with this tool.
Tells whether the deep learning tool has been trained.
Indicates whether the object is currently training.
Loads a deep learning tool. The given ESerializer must have been created for reading.
Loads the tool's inference model. The inference model is required to apply the tool on new images.
Loads the settings of a tool.
Loads the tool's training model. The training model is required to continue a training.
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
Saves the tool's inference model to a file.
Saves the settings of the tool to a file.
Saves the tool's training model to a file.
Serializes the inference model of the tool.
Serializes the tool settings.
Serializes the training model of the tool.
The training model is necessary to continue training the tool.
Sets the device with which to run or train the model.
Sets the device with which to run the model using its index in the list returned by EDeepLearningTool::AvailableDevices.
Sets the device with which to run the model using its name.
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
Sets the devices with which to run the model using their index in the list returned by EDeepLearningTool::AvailableDevices.
Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model.
In order for the model to be automatically saved during the training, the tool must have been loaded or saved to a file. The path where the tool will be saved is either indicated by EDeepLearningTool::Path or the three paths EDeepLearningTool::SettingsPath, EDeepLearningTool::InferenceModelPath, and EDeepLearningTool::TrainingModelPath. If one of these path is empty, the corresponding part of the tool will not be saved automatically during training.
By default, auto save is disabled and the period is equal to 0.
Batch size. The batch size is the number of images that are processed together during training and batch inference.
When using multi-GPUs processing (see EDeepLearningTool::GPUIndexes), the batch size is the number of images that each GPU will process at once.
A large batch size will increase the processing speed on GPU but also the memory requirements.
The batch size must be bigger or equal to 1 and it is commonly chosen to be a power of 2.
Random seed to use when EDeepLearningTool::EnableDeterministicTraining is set to true. The default value is 42.
When EDeepLearningTool::EnableDeterministicTraining, the random seed is generated using a random non-deterministic source.
Whether to use determinitic training algorithm that allows to repeatable training results. Default value: false.
Deprecated: Use EDeepLearningTool.
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::EnableGPU will be false even if the active device has a GPU device type. Setting EDeepLearningTool::EnableGPU to any value when the active engine is not the default one will throw an exception.
Sets the engine with which to execute or train the neural network.
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
Deprecated: use EDeepLearningTool or EDeepLearningTool::ActiveDevices.
Indexes of the GPUs to use for computations.
Using multiple GPUs is only possible when we can process multiple images at once, i.e. during training (EDeepLearningTool::Train) or batch inference.
By default, all the detected GPUs will be used.
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.
Inference precision.
Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.
Changes a label predicted by the tool.
Changes a label color.
Changes a label opacity (between 0 for fully transparent and 255 for opaque color).
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.
Indicates whether to optimize the batch size (see EDeepLearningTool::BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
Default value is true.
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.
Trains the EDeepLearningTool 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::BestIteration.
Unloads the inference model.
Unloads the inference and training model.
Unloads the training model.
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.
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.
A negative timeout means that the method will wait until the training is complete.
The default value is set to -1.
The method returns the number of trained iterations.

EDeepLearningTool Class

EDeepLearningTool represents the common operations of deep learning tools.

The class is responsible for handling CPU/GPU settings and training.
Computing the result for an image is called inference and is the responsability of the actual deep learning tools (see EClassifier).

Derived Class(es):EClassifierELocatorBaseESupervisedSegmenterEUnsupervisedSegmenter

Namespace: Euresys.Open_eVision.EasyDeepLearning

Properties

Sets the device with which to run the model using its index in the list returned by EDeepLearningTool::AvailableDevices.
Sets the device with which to run the model using its name.
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
Sets the devices with which to run the model using their index in the list returned by EDeepLearningTool::AvailableDevices.
Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model.
In order for the model to be automatically saved during the training, the tool must have been loaded or saved to a file. The path where the tool will be saved is either indicated by EDeepLearningTool::Path or the three paths EDeepLearningTool::SettingsPath, EDeepLearningTool::InferenceModelPath, and EDeepLearningTool::TrainingModelPath. If one of these path is empty, the corresponding part of the tool will not be saved automatically during training.
By default, auto save is disabled and the period is equal to 0.
Get all available device for the current engine.
Available engines.
Batch size. The batch size is the number of images that are processed together during training and batch inference.
When using multi-GPUs processing (see EDeepLearningTool::GPUIndexes), the batch size is the number of images that each GPU will process at once.
A large batch size will increase the processing speed on GPU but also the memory requirements.
The batch size must be bigger or equal to 1 and it is commonly chosen to be a power of 2.
Computes the batch size that will maximize the inference speed on NVIDIA GPU. For all other devices, it will return 1.
Iteration at which the minimum validation error was reached. After training, the tool is in the state it was at this best iteration.
Number of iterations that are already finished in the current training.
Total number of training iterations that will be performed during the current training of the deep learning tool.
After the end of the training, this number is the actual number of iterations performed during the training which can be lower than the number of iterations given to the EDeepLearningTool::Train method (for example if the user called EDeepLearningTool::StopTraining).
Current training progression as a percentage (between 0 and 1).
Random seed to use when EDeepLearningTool::EnableDeterministicTraining is set to true. The default value is 42.
When EDeepLearningTool::EnableDeterministicTraining, the random seed is generated using a random non-deterministic source.
Whether to use determinitic training algorithm that allows to repeatable training results. Default value: false.
Deprecated: Use EDeepLearningTool.
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::EnableGPU will be false even if the active device has a GPU device type. Setting EDeepLearningTool::EnableGPU to any value when the active engine is not the default one will throw an exception.
Sets the engine with which to execute or train the neural network.
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
Deprecated: use EDeepLearningTool or EDeepLearningTool::ActiveDevices.
Indexes of the GPUs to use for computations.
Using multiple GPUs is only possible when we can process multiple images at once, i.e. during training (EDeepLearningTool::Train) or batch inference.
By default, all the detected GPUs will be used.
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.
Inference precision.
Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.
Gets the number of devices with which to run or train the model.
Available devices for the current EDeepLearningTool::Engine.
Number of available engines.
Deprecated: use EDeepLearningTool with a device type of GPU.
Number of detected NVIDIA GPU.
Number of labels of this tool. If the tool is not trained, the method will throw an exception.
Number of iterations that were performed to train this deep learning tool.
Indicates whether to optimize the batch size (see EDeepLearningTool::BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
Default value is true.
Path of the tool when loaded or saved using EDeepLearningTool::Save, EDeepLearningTool::Load or EDeepLearningTool.
Type of the deep learning tool.

Methods

Factory method to open a deep learning tool.
Returns the corresponding deep learning tool that must be deleted by the caller.
Gets the active device. By default, it returns the first active device.
Name of the i-th device of the current engine.
Available devices for the specified engine.
Gets the name of the engine given its id.
Gets the label from its index. If the tool is not trained, the method may throw an exception.
Label color. The label colors affect how the results will be displayed.
The default label colors are the one specified in the dataset used for training.
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.
The default label opacities are the one specified in the dataset used for training.
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.
Number of patches that will be extracted from an input image to perform inference.
For EasyClassify and EasyLocate, this will always be equal to 1.
For EasySegment, the number of patches will depend on the scale, patch size and sampling density parameters.
Optimal number of images to process together for inference given the batch size and EDeepLearningTool::GetNumPatchesForImage.
In practice, for EasyClassify and EasyLocate, this is the same as the batch size.
For EasySegment, the value will depend on the scale, patch size and sampling density parameters.
Whether the inference model is loaded or created when the tool is not yet trained.
Whether the training model is loaded or created when the tool is not yet trained.
Initializes the neural network for inference (i.e. making predictions with the neural network).
You need to pass an image or a vector of images with the same characteristics (image resolution, image type and number of image) as the image or vector of images that you will use to make inference with this tool.
Tells whether the deep learning tool has been trained.
Indicates whether the object is currently training.
Loads a deep learning tool. The given ESerializer must have been created for reading.
Loads the tool's inference model. The inference model is required to apply the tool on new images.
Loads the settings of a tool.
Loads the tool's training model. The training model is required to continue a training.
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
Saves the tool's inference model to a file.
Saves the settings of the tool to a file.
Saves the tool's training model to a file.
Serializes the inference model of the tool.
Serializes the tool settings.
Serializes the training model of the tool.
The training model is necessary to continue training the tool.
Sets the device with which to run or train the model.
Changes a label predicted by the tool.
Changes a label color.
Changes a label opacity (between 0 for fully transparent and 255 for opaque color).
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.
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.
Trains the EDeepLearningTool 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::BestIteration.
Unloads the inference model.
Unloads the inference and training model.
Unloads the training model.
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.
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.
A negative timeout means that the method will wait until the training is complete.
The default value is set to -1.
The method returns the number of trained iterations.