EDeepLearningTool represents the common operations of deep learning tools. More...


Public Member Functions | |
| virtual void | Load (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. | |
| eVision.EasyDeepLearning.EDeepLearningTool | Clone () |
| Clones this tool. | |
| virtual void | Save (string filePath, bool includeTrainingModel) |
| Saves the settings, inference and training model of the deep learning tool. | |
| virtual void | Save (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 | SerializeSettings (eVision.ESerializer serializer) |
| Serializes the tool settings. | |
| 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 (string filePath) |
| Saves the settings of the tool to a file. | |
| void | SaveInferenceModel (string filePath) |
| Saves the tool's inference model to a file. | |
| void | SaveTrainingModel (string filePath) |
| Saves the tool's training model to a file. | |
| void | LoadSettings (string filePath) |
| Loads the settings of a tool. | |
| void | LoadInferenceModel (string filePath) |
| Loads the tool's inference model. The inference model is required to apply the tool on new images. | |
| void | LoadTrainingModel (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 () |
| Whether the inference model is loaded or created when the tool is not yet trained. | |
| bool | HasTrainingModel () |
| Whether the training model is loaded or created when the tool is not yet trained. | |
| bool | IsTrained () |
| Tells whether the deep learning tool has been trained. | |
| string | GetAvailableDeviceName (int i) |
| Name of the i-th device of the current engine. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetAvailableDevice (int i) |
| i-th EDeepLearningDevice of the current engine. | |
| void | SetActiveDevice (eVision.EasyDeepLearning.EDeepLearningDevice device) |
| Sets the device with which to run or train the model. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetActiveDevice (int i) |
| Gets the active device. By default, it returns the first active device. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetActiveDevice () |
| Gets the active device. By default, it returns the first active device. | |
| bool | HasEngineSetupData () |
| 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. | |
| bool | IsTraining () |
| 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. | |
| void | SetLearningRate (eVision.EasyDeepLearning.EDeepLearningLearningRateType type, float[] parameters) |
| Specifies how the value of the learning rate and how it evolves during training. | |
| 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 (eVision.EBaseROI img) |
| Initializes the neural network for inference (i.e. making predictions with the neural network). | |
| void | InitializeInference (ref eVision.EBaseROI[] imgList) |
| Initializes the neural network for inference (i.e. making predictions with the neural network). | |
| void | InitializeInference (ref eVision.EImageBW8[] imgList) |
| Initializes the neural network for inference (i.e. making predictions with the neural network). | |
| void | InitializeInference (ref eVision.EImageBW16[] imgList) |
| Initializes the neural network for inference (i.e. making predictions with the neural network). | |
| void | InitializeInference (ref eVision.EImageC24[] imgList) |
| Initializes the neural network for inference (i.e. making predictions with the neural network). | |
| string | GetLabel (uint index) |
| Gets the label from its index. If the tool is not trained, the method may throw an exception. | |
| virtual void | SetLabel (uint index, string label) |
| Changes a label predicted by the tool. | |
| void | SetLabelWeight (uint 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 (uint index) |
| 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 (uint index, eVision.ERGBColor c) |
| Changes a label color. | |
| eVision.ERGBColor | GetLabelColor (uint index) |
| Label color. The label colors affect how the results will be displayed. | |
| void | SetLabelOpacity (uint index, byte opacity) |
| Changes a label opacity (between 0 for fully transparent and 255 for opaque color). | |
| byte | GetLabelOpacity (uint index) |
| 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 (eVision.EBaseROI sampleImage) |
| Optimal number of images to process together for inference given the batch size and EDeepLearningTool.GetNumPatchesForImage. | |
| int | GetOptimalNumImagesForBatchSize (int imageWidth, int imageHeight) |
| Optimal number of images to process together for inference given the batch size and EDeepLearningTool.GetNumPatchesForImage. | |
| int | GetNumPatchesForImage (eVision.EBaseROI sampleImage) |
| Number of patches that will be extracted from an input image to perform inference. | |
| virtual int | GetNumPatchesForImage (int imageWidth, int imageHeight) |
| 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. | |
Static Public Member Functions | |
| static eVision.EasyDeepLearning.EDeepLearningTool | Create (string path) |
| Factory method to open a deep learning tool. | |
| static eVision.EasyDeepLearning.EDeepLearningTool | Create (eVision.ESerializer serializer) |
| Factory method to open a deep learning tool. | |
| static eVision.EasyDeepLearning.EDeepLearningTool | Create (eVision.EasyDeepLearning.EDeepLearningToolType type) |
| Factory method to open a deep learning tool. | |
| static string | GetAvailableEngineName (int id) |
| Gets the name of the engine given its id. | |
| static eVision.EasyDeepLearning.EDeepLearningDevice[] | GetAvailableDevicesForEngine (string engine) |
| Available devices for the specified engine. | |
Properties | |
| eVision.EasyDeepLearning.EDeepLearningToolType | ToolType [get] |
| Type of the deep learning tool. | |
| bool | EnableGPU [get, set] |
| 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. | |
| uint[] | GPUIndexes [get, set] |
| Indexes of the GPUs to use for computations. | |
| uint | NumGPUs [get] |
| Number of detected NVIDIA GPU. | |
| string | Engine [get, set] |
| Sets the engine with which to execute or train the neural network. | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | InferencePrecision [get, set] |
| Inference precision. | |
| int | NumAvailableDevices [get] |
| Available devices for the current EDeepLearningTool.Engine. | |
| eVision.EasyDeepLearning.EDeepLearningDevice[] | AvailableDevices [get] |
| Get all available device for the current engine. | |
| int | NumActiveDevices [get] |
| Gets the number of devices with which to run or train the model. | |
| string | ActiveDeviceByName [set] |
| Sets the device with which to run the model using its name. | |
| int | ActiveDeviceById [set] |
| Sets the device with which to run the model using its index in the list returned by EDeepLearningTool.AvailableDevices. | |
| eVision.EasyDeepLearning.EDeepLearningDevice[] | ActiveDevices [get, set] |
| Devices with which to run or train the model. | |
| int[] | ActiveDevicesById [set] |
| Sets the devices with which to run the model using their index in the list returned by EDeepLearningTool.AvailableDevices. | |
| eVision.EasyDeepLearning.EDeepLearningExecutionSettings | ExecutionSettings [get, set] |
| Execution settings of the tool (engine, device(s), inference precision, batch size settings). | |
| eVision.EasyDeepLearning.EDeepLearningDevice | EngineSetupDataDevice [get] |
| Device corresponding to the engine data contained in the tool. | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | EngineSetupDataInferencePrecision [get] |
| Inference precision corresponding to the engine data contained in the tool. | |
| int | EngineSetupDataBatchSize [get] |
| Batch size corresponding to the engine data contained in the tool. | |
| bool | OptimizeBatchSize [get, set] |
| 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. | |
| int | BatchSizeForMaximumInferenceSpeed [get] |
| Computes the batch size that will maximize the inference speed on NVIDIA GPU. For all other devices, it will return 1. | |
| int | BatchSize [get, set] |
| Batch size. The batch size is the number of images that are processed together during training and batch inference. | |
| float | CurrentTrainingProgression [get] |
| Current training progression as a percentage (between 0 and 1). | |
| uint | CurrentTrainingFinishedIterations [get] |
| Number of iterations that are already finished in the current training. | |
| uint | CurrentTrainingNumIterations [get] |
| Total number of training iterations that will be performed during the current training of the deep learning tool. | |
| uint | NumTrainedIterations [get] |
| Number of iterations that were performed to train this deep learning tool. | |
| int | BestIteration [get] |
| Iteration at which the minimum validation error was reached. After training, the tool is in the state it was at this best iteration. | |
| ulong | ImageCacheSize [get, set] |
| 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. | |
| string | Path [get] |
| Path of the tool when loaded or saved using EDeepLearningTool.Save or EDeepLearningTool.Load. | |
| string | InferenceModelPath [get] |
| Path of the inference model when loaded or saved using EDeepLearningTool.SaveInferenceModel, EDeepLearningTool.LoadInferenceModel or EDeepLearningTool.SerializeInferenceModel. | |
| string | TrainingModelPath [get] |
| Path of the training model when loaded or saved using EDeepLearningTool.SaveTrainingModel, EDeepLearningTool.LoadTrainingModel or EDeepLearningTool.SerializeTrainingModel. | |
| string | SettingsPath [get] |
| Path of the settings when loaded or saved using EDeepLearningTool.SaveSettings, EDeepLearningTool.LoadSettings or EDeepLearningTool.SerializeSettings. | |
| int | AutoSavePeriod [get, set] |
| Auto-save period. The auto-save period is the number of training iterations between each automatic save of the model. | |
| eVision.EasyDeepLearning.EDeepLearningLearningRateType | LearningRateType [get] |
| Learning rate type. | |
| float[] | LearningRateParameters [get] |
| Parameters of the learning rate. | |
| bool | EnableDeterministicTraining [get, set] |
| Whether to use deterministic training algorithm that allows to repeatable training results. Default value: false. | |
| int | DeterministicTrainingRandomSeed [get, set] |
| Random seed to use when EDeepLearningTool.EnableDeterministicTraining is set to true. The default value is 42. | |
| uint | NumLabels [get] |
| Number of labels of this tool. If the tool is not trained, the method will throw an exception. | |
| static int | NumAvailableEngines [get] |
| Number of available engines. | |
| static string[] | AvailableEngines [get] |
| Available engines. | |
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 responsibility of the actual deep learning tools (see EClassifier).
License(s): EasyClassify or EasySegment or EasyLocate or EasyClassifyInference or EasySegmentInference or EasyLocateInference
|
virtual |
Reset the engine and clean CPU and GPU memory allocated for running the model.
This method does not clean all GPU memory. For example, some program data (CUDA kernels) will be kept in GPU memory.
| void eVision.EasyDeepLearning.EDeepLearningTool.ClearEngineSetupData | ( | ) |
Clears the engine data saved in the inference model. Use this method when your engine fails.
| eVision.EasyDeepLearning.EDeepLearningTool eVision.EasyDeepLearning.EDeepLearningTool.Clone | ( | ) |
Clones this tool.
|
static |
Factory method to open a deep learning tool.
| type | Type of tool to create |
|
static |
Factory method to open a deep learning tool.
| serializer | A serializer created for reading. |
|
static |
Factory method to open a deep learning tool.
| path | Path to a deep learning tool. |
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice | ( | ) |
Gets the active device. By default, it returns the first active device.
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice | ( | int | i | ) |
Gets the active device. By default, it returns the first active device.
| i | Index of the active devices between 0 and EDeepLearningTool.NumActiveDevices. |
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetAvailableDevice | ( | int | i | ) |
i-th EDeepLearningDevice of the current engine.
| i | Index of the device between 0 and EDeepLearningTool.NumAvailableDevices - 1. |
| string eVision.EasyDeepLearning.EDeepLearningTool.GetAvailableDeviceName | ( | int | i | ) |
Name of the i-th device of the current engine.
| i | Index of the device between 0 and EDeepLearningTool.NumAvailableDevices - 1. |
|
static |
Available devices for the specified engine.
| engine | Engine for which to get the devices |
|
static |
Gets the name of the engine given its id.
| id | Index of the available engine between 0 and EDeepLearningTool.NumAvailableEngines - 1. |
| string eVision.EasyDeepLearning.EDeepLearningTool.GetLabel | ( | uint | index | ) |
Gets the label from its index. If the tool is not trained, the method may throw an exception.
| index | Index of the label |
| eVision.ERGBColor eVision.EasyDeepLearning.EDeepLearningTool.GetLabelColor | ( | uint | index | ) |
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.
| index | Index of the label between 0 and EDeepLearningTool.NumLabels |
| byte eVision.EasyDeepLearning.EDeepLearningTool.GetLabelOpacity | ( | uint | index | ) |
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.
| index | Index of the label between 0 and EDeepLearningTool.NumLabels |
| float eVision.EasyDeepLearning.EDeepLearningTool.GetLabelWeight | ( | uint | index | ) |
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.
| index | Index of the label |
| int eVision.EasyDeepLearning.EDeepLearningTool.GetNumPatchesForImage | ( | eVision.EBaseROI | sampleImage | ) |
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.
| sampleImage | Image for which to get the number of patch |
|
virtual |
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.
| imageWidth | Width of the image for which to get the number of patch |
| imageHeight | Height of the image for which to get the number of patch |
Reimplemented in eVision.EasyDeepLearning.ESupervisedSegmenter, and eVision.EasyDeepLearning.EUnsupervisedSegmenter.
| int eVision.EasyDeepLearning.EDeepLearningTool.GetOptimalNumImagesForBatchSize | ( | eVision.EBaseROI | sampleImage | ) |
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.
| sampleImage | Image for which to get the optimal number of images |
| int eVision.EasyDeepLearning.EDeepLearningTool.GetOptimalNumImagesForBatchSize | ( | int | imageWidth, |
| int | imageHeight ) |
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.
| imageWidth | Width of the image for which to get the optimal number of images |
| imageHeight | Height of the image for which to get the optimal number of images |
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasEngineSetupData | ( | ) |
Whether the inference model has engine setup data.
Engine setup data allows for quicker configuration of the engine when reusing the same device, inference precision and batch size.
Use EDeepLearningTool.EngineSetupDataDevice, EDeepLearningTool.EngineSetupDataInferencePrecision, and EDeepLearningTool.EngineSetupDataBatchSize to retrieve the device (and engine), inference precision, and batch size for which the tool has engine setup data.
The engine setup data is stored in the tool after the first inference or after calling EDeepLearningTool.InitializeInference if the engine supports it. At the moment, only the TensorRT engine supports setup data. If you save the tool, the engine setup data will be saved with the tool and can be reused when loading the tool again.
The engine setup data will only be replaced when using another device and/or inference precision and/or batch size with an engine that supports engine setup data. Otherwise, this setup data will remain (for example, using an engine that does not supports setup data will leave the pervious engine setup data intact).
You can clear the engine setup data by using EDeepLearningTool.ClearEngineSetupData.
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasInferenceModel | ( | ) |
Whether the inference model is loaded or created when the tool is not yet trained.
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasTrainingModel | ( | ) |
Whether the training model is loaded or created when the tool is not yet trained.
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | eVision.EBaseROI | img | ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| img | Image for which to prepare the tool for inference |
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | int | width, |
| int | height, | ||
| eVision.EImageType | imageType, | ||
| int | numImages ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| width | Width of the images for which to prepare the tool for inference |
| height | Height of the images for which to prepare the tool for inference |
| imageType | Type of the images for which to prepare the tool for inference |
| numImages | Number of images for which to prepare the tool for inference |
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | ref eVision.EBaseROI[] | imgList | ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| imgList | Vector of images for which to prepare the tool for inference |
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | ref eVision.EImageBW16[] | imgList | ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| imgList | Vector of images for which to prepare the tool for inference |
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | ref eVision.EImageBW8[] | imgList | ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| imgList | Vector of images for which to prepare the tool for inference |
| void eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | ref eVision.EImageC24[] | imgList | ) |
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.
If EDeepLearningTool.OptimizeBatchSize is equal to true, the value of EDeepLearningTool.BatchSize will be recomputed.
| imgList | Vector of images for which to prepare the tool for inference |
| bool eVision.EasyDeepLearning.EDeepLearningTool.IsTrained | ( | ) |
Tells whether the deep learning tool has been trained.
| bool eVision.EasyDeepLearning.EDeepLearningTool.IsTraining | ( | ) |
Indicates whether the object is currently training.
|
virtual |
Loads a deep learning tool. The given ESerializer must have been created for reading.
| serializer | Pointer to the ESerializer created for reading. |
|
virtual |
Loads a deep learning tool. The given ESerializer must have been created for reading.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.LoadInferenceModel | ( | string | filePath | ) |
Loads the tool's inference model. The inference model is required to apply the tool on new images.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.LoadSettings | ( | string | filePath | ) |
Loads the settings of a tool.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.LoadTrainingModel | ( | string | filePath | ) |
Loads the tool's training model. The training model is required to continue a training.
| filePath | File path. |
|
virtual |
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
| serializer | Pointer to the ESerializer created for writing. |
|
virtual |
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
| serializer | Pointer to the ESerializer created for writing. |
| includeTrainingModel | Whether to save the training model. The training model is required to continue training the tool. |
|
virtual |
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
| filePath | File path. |
|
virtual |
Saves the settings, inference and training model of the deep learning tool.
The given ESerializer must have been created for writing.
| filePath | File path. |
| includeTrainingModel | Whether to save the training model. The training model is required to continue training the tool. |
| void eVision.EasyDeepLearning.EDeepLearningTool.SaveInferenceModel | ( | string | filePath | ) |
Saves the tool's inference model to a file.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.SaveSettings | ( | string | filePath | ) |
Saves the settings of the tool to a file.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.SaveTrainingModel | ( | string | filePath | ) |
Saves the tool's training model to a file.
| filePath | File path. |
| void eVision.EasyDeepLearning.EDeepLearningTool.SerializeInferenceModel | ( | eVision.ESerializer | serializer | ) |
Serializes the inference model of the tool.
| serializer | Pointer to ESerializer |
|
abstract |
Serializes the tool settings.
| serializer | Pointer to ESerializer |
| void eVision.EasyDeepLearning.EDeepLearningTool.SerializeTrainingModel | ( | eVision.ESerializer | serializer | ) |
Serializes the training model of the tool.
The training model is necessary to continue training the tool.
| serializer | Pointer to ESerializer |
| void eVision.EasyDeepLearning.EDeepLearningTool.SetActiveDevice | ( | eVision.EasyDeepLearning.EDeepLearningDevice | device | ) |
Sets the device with which to run or train the model.
| device | The device with which to run or train the model. |
For CPU device, the number of thread is initialized from Easy.MaxNumberOfProcessingThreads.
Note that this can change EDeepLearningTool.InferencePrecision if the previously set value was incompatible with the device.
|
virtual |
Changes a label predicted by the tool.
| index | Index of the label |
| label | New label |
Be careful when changing one of the label of a trained tool. It can create incompatibilities with previous metrics or results computed with this tool or with the dataset used to trained the tool.
Some tools may not use this label API. For example EUnsupervisedSegmenter uses EUnsupervisedSegmenter.GoodLabel instead.
| void eVision.EasyDeepLearning.EDeepLearningTool.SetLabelColor | ( | uint | index, |
| eVision.ERGBColor | c ) |
Changes a label color.
| index | Index of the label between 0 and EDeepLearningTool.NumLabels |
| c | New color for the specified label |
| void eVision.EasyDeepLearning.EDeepLearningTool.SetLabelOpacity | ( | uint | index, |
| byte | opacity ) |
Changes a label opacity (between 0 for fully transparent and 255 for opaque color).
| index | Index of the label between 0 and EDeepLearningTool.NumLabels |
| opacity | New opacity for the specified label |
| void eVision.EasyDeepLearning.EDeepLearningTool.SetLabelWeight | ( | uint | 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.
| index | Index of the label |
| weight | Weight |
| void eVision.EasyDeepLearning.EDeepLearningTool.SetLearningRate | ( | eVision.EasyDeepLearning.EDeepLearningLearningRateType | type, |
| float[] | parameters ) |
Specifies how the value of the learning rate and how it evolves during training.
| int eVision.EasyDeepLearning.EDeepLearningTool.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.
| wait | Whether to wait for the training to completely stop |
| void eVision.EasyDeepLearning.EDeepLearningTool.UnloadInferenceModel | ( | ) |
Unloads the inference model.
| void eVision.EasyDeepLearning.EDeepLearningTool.UnloadModels | ( | ) |
Unloads the inference and training model.
| void eVision.EasyDeepLearning.EDeepLearningTool.UnloadTrainingModel | ( | ) |
Unloads the training model.
| int eVision.EasyDeepLearning.EDeepLearningTool.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 eVision.EasyDeepLearning.EDeepLearningTool.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.
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.
| int eVision.EasyDeepLearning.EDeepLearningTool.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.
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.
| timeout | Timeout in second |
|
set |
Sets the device with which to run the model using its index in the list returned by EDeepLearningTool.AvailableDevices.
|
set |
Sets the device with which to run the model using its name.
|
getset |
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
|
set |
Sets the devices with which to run the model using their index in the list returned by EDeepLearningTool.AvailableDevices.
|
getset |
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 |
Get all available device for the current engine.
|
staticget |
Available engines.
|
getset |
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.
If EDeepLearningTool.OptimizeBatchSize is 'true', then the value of this property will be optimized automatically for training or inference according to the situation.
See also EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
|
get |
Computes the batch size that will maximize the inference speed on NVIDIA GPU. For all other devices, it will return 1.
This value is given as an indication and should not necessarily be used in practice.
You must choose a tradeoff between the overall inference speed (also called the throughput), which is limited by this value, and the time it takes to compute the result of a whole batch (also called the latency), which is minimized by making inference image per image (i.e. a batch size of 1). The tradeoff depends on your particular application.
Throw EError_DeepLearningToolNotTrained if the tool is not trained.
|
get |
Iteration at which the minimum validation error was reached. After training, the tool is in the state it was at this best iteration.
|
get |
Number of iterations that are already finished in the current training.
|
get |
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 training method (for example if the user called EDeepLearningTool.StopTraining).
|
get |
Current training progression as a percentage (between 0 and 1).
|
getset |
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.
|
getset |
Whether to use deterministic training algorithm that allows to repeatable training results. Default value: false.
Deterministic training is not guaranteed when:
|
getset |
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.
|
getset |
Sets the engine with which to execute or train the neural network.
|
get |
Batch size corresponding to the engine data contained in the tool.
|
get |
Device corresponding to the engine data contained in the tool.
|
get |
Inference precision corresponding to the engine data contained in the tool.
|
getset |
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
|
getset |
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 or batch inference.
By default, all the detected GPUs will be used.
The GPU are indexed from 0 to EDeepLearningTool.NumGPUs - 1.
Use EDeepLearningTool.GetActiveDevice or EDeepLearningTool.ActiveDevices.
Deprecated in version 23.4. Scheduled to be removed in version 27.6.
|
getset |
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.
|
get |
Path of the inference model when loaded or saved using EDeepLearningTool.SaveInferenceModel, EDeepLearningTool.LoadInferenceModel or EDeepLearningTool.SerializeInferenceModel.
|
getset |
Inference precision.
Use EDeepLearningDevice.IsPrecisionSupported to check whether a device support the given precision.
|
get |
Parameters of the learning rate.
|
get |
Learning rate type.
|
get |
Gets the number of devices with which to run or train the model.
|
get |
Available devices for the current EDeepLearningTool.Engine.
|
staticget |
Number of available engines.
|
get |
Number of detected NVIDIA GPU.
Use EDeepLearningTool.NumAvailableDevices or parse the output of EDeepLearningTool.AvailableDevices to find the devices that are GPUs.
Deprecated in version 23.4. Scheduled to be removed in version 27.6.
|
get |
Number of labels of this tool. If the tool is not trained, the method will throw an exception.
Some type of tools such as EUnsupervisedSegmenter may have no label at all. For these tools, there is a separate API to control the predicted labels.
|
get |
Number of iterations that were performed to train this deep learning tool.
This number of iteration may result from the addition of the iterations performed in several calls to the training method.
An iteration can also be called an epoch.
|
getset |
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.
The batch size will be optimized at the start of training or during EDeepLearningTool.InitializeInference.
|
get |
Path of the tool when loaded or saved using EDeepLearningTool.Save or EDeepLearningTool.Load.
|
get |
Path of the settings when loaded or saved using EDeepLearningTool.SaveSettings, EDeepLearningTool.LoadSettings or EDeepLearningTool.SerializeSettings.
|
getabstract |
Type of the deep learning tool.
|
get |
Path of the training model when loaded or saved using EDeepLearningTool.SaveTrainingModel, EDeepLearningTool.LoadTrainingModel or EDeepLearningTool.SerializeTrainingModel.