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

Public Member Functions | |
| None | Load (self, str filePath) |
| Loads a deep learning tool. | |
| None | Load (self, eVision.ESerializer|None serializer) |
| Loads a deep learning tool. | |
| eVision.EasyDeepLearning.EDeepLearningTool|None | Clone (self) |
| Clones this tool. | |
| None | Save (self, str filePath, bool includeTrainingModel) |
| Saves the settings, inference and training model of the deep learning tool. | |
| None | Save (self, str filePath) |
| Saves the settings, inference and training model of the deep learning tool. | |
| None | Save (self, eVision.ESerializer|None serializer, bool includeTrainingModel) |
| Saves the settings, inference and training model of the deep learning tool. | |
| None | Save (self, eVision.ESerializer|None serializer) |
| Saves the settings, inference and training model of the deep learning tool. | |
| None | SerializeSettings (self, eVision.ESerializer|None serializer) |
| Serializes the tool settings. | |
| None | SerializeInferenceModel (self, eVision.ESerializer|None serializer) |
| Serializes the inference model of the tool. | |
| None | SerializeTrainingModel (self, eVision.ESerializer|None serializer) |
| Serializes the training model of the tool. | |
| None | SaveSettings (self, str filePath) |
| Saves the settings of the tool to a file. | |
| None | SaveInferenceModel (self, str filePath) |
| Saves the tool's inference model to a file. | |
| None | SaveTrainingModel (self, str filePath) |
| Saves the tool's training model to a file. | |
| None | LoadSettings (self, str filePath) |
| Loads the settings of a tool. | |
| None | LoadInferenceModel (self, str filePath) |
| Loads the tool's inference model. | |
| None | LoadTrainingModel (self, str filePath) |
| Loads the tool's training model. | |
| None | UnloadInferenceModel (self) |
| Unloads the inference model. | |
| None | UnloadTrainingModel (self) |
| Unloads the training model. | |
| None | UnloadModels (self) |
| Unloads the inference and training model. | |
| bool | HasInferenceModel (self) |
| Whether the inference model is loaded or created when the tool is not yet trained. | |
| bool | HasTrainingModel (self) |
| Whether the training model is loaded or created when the tool is not yet trained. | |
| bool | IsTrained (self) |
| Tells whether the deep learning tool has been trained. | |
| str | GetAvailableDeviceName (self, int i) |
| Name of the i-th device of the current engine. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetAvailableDevice (self, int i) |
| i-th eVision.EasyDeepLearning.EDeepLearningDevice of the current engine. | |
| None | SetActiveDevice (self, eVision.EasyDeepLearning.EDeepLearningDevice device) |
| Sets the device with which to run or train the model. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetActiveDevice (self, int i) |
| Gets the active device. | |
| eVision.EasyDeepLearning.EDeepLearningDevice | GetActiveDevice (self) |
| Gets the active device. | |
| bool | HasEngineSetupData (self) |
| Whether the inference model has engine setup data. | |
| None | ClearEngineSetupData (self) |
| Clears the engine data saved in the inference model. | |
| bool | IsTraining (self) |
| Indicates whether the object is currently training. | |
| int | WaitForTrainingCompletion (self, int timeout) |
| Waits until the training is complete or the timeout is expired. | |
| int | WaitForTrainingCompletion (self) |
| Waits until the training is complete or the timeout is expired. | |
| int | WaitForIterationCompletion (self) |
| Waits until an iteration is complete. | |
| int | StopTraining (self, bool wait) |
| Stops training and returns the last completed iteration. | |
| None | SetLearningRate (self, eVision.EasyDeepLearning.EDeepLearningLearningRateType type, list[float] parameters) |
| Specifies how the value of the learning rate and how it evolves during training. | |
| None | InitializeInference (self, int width, int height, eVision.EImageType imageType, int numImages) |
| Initializes the neural network for inference (i.e. | |
| None | InitializeInference (self, eVision.EBaseROI img) |
| Initializes the neural network for inference (i.e. | |
| None | InitializeInference (self, list[eVision._eVision.EBaseROI|None] imgList) |
| Initializes the neural network for inference (i.e. | |
| str | GetLabel (self, int index) |
| Gets the label from its index. | |
| None | SetLabel (self, int index, str label) |
| Changes a label predicted by the tool. | |
| None | SetLabelWeight (self, int index, float weight) |
| Sets the label weight. | |
| float | GetLabelWeight (self, int index) |
| Gets the label weight. | |
| None | SetLabelColor (self, int index, eVision.ERGBColor c) |
| Changes a label color. | |
| eVision.ERGBColor | GetLabelColor (self, int index) |
| Label color. | |
| None | SetLabelOpacity (self, int index, int opacity) |
| Changes a label opacity (between 0 for fully transparent and 255 for opaque color). | |
| int | GetLabelOpacity (self, int index) |
| Gets the label opacity (between 0 for fully transparent and 255 for opaque color). | |
| int | GetOptimalNumImagesForBatchSize (self, eVision.EBaseROI sampleImage) |
| Optimal number of images to process together for inference given the batch size and eVision.EasyDeepLearning.EDeepLearningTool.GetNumPatchesForImage. | |
| int | GetOptimalNumImagesForBatchSize (self, int imageWidth, int imageHeight) |
| Optimal number of images to process together for inference given the batch size and eVision.EasyDeepLearning.EDeepLearningTool.GetNumPatchesForImage. | |
| int | GetNumPatchesForImage (self, eVision.EBaseROI sampleImage) |
| Number of patches that will be extracted from an input image to perform inference. | |
| int | GetNumPatchesForImage (self, int imageWidth, int imageHeight) |
| Number of patches that will be extracted from an input image to perform inference. | |
| None | Clean (self) |
| Reset the engine and clean CPU and GPU memory allocated for running the model. | |
| eVision.EasyDeepLearning.EDeepLearningToolType | ToolType (self) |
| Type of the deep learning tool. | |
| bool | EnableGPU (self) |
| Enable the use of a GPU for training and inference of the deep learning tool. | |
| EnableGPU (self, bool value) | |
| Enable the use of a GPU for training and inference of the deep learning tool. | |
| list[int] | GPUIndexes (self) |
| Indexes of the GPUs to use for computations. | |
| GPUIndexes (self, list[int] value) | |
| Indexes of the GPUs to use for computations. | |
| int | NumGPUs (self) |
| Number of detected NVIDIA GPU. | |
| str | Engine (self) |
| Sets the engine with which to execute or train the neural network. | |
| Engine (self, str value) | |
| Sets the engine with which to execute or train the neural network. | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | InferencePrecision (self) |
| Inference precision. | |
| InferencePrecision (self, eVision.EasyDeepLearning.EDeepLearningInferencePrecision value) | |
| Inference precision. | |
| int | NumAvailableDevices (self) |
| Available devices for the current eVision.EasyDeepLearning.EDeepLearningTool.Engine. | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | AvailableDevices (self) |
| Get all available device for the current engine. | |
| int | NumActiveDevices (self) |
| Gets the number of devices with which to run or train the model. | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | ActiveDevices (self) |
| Devices with which to run or train the model. | |
| ActiveDevices (self, list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] value) | |
| Devices with which to run or train the model. | |
| eVision.EasyDeepLearning.EDeepLearningExecutionSettings | ExecutionSettings (self) |
| Execution settings of the tool (engine, device(s), inference precision, batch size settings). | |
| ExecutionSettings (self, eVision.EasyDeepLearning.EDeepLearningExecutionSettings value) | |
| Execution settings of the tool (engine, device(s), inference precision, batch size settings). | |
| eVision.EasyDeepLearning.EDeepLearningDevice | EngineSetupDataDevice (self) |
| Device corresponding to the engine data contained in the tool. | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | EngineSetupDataInferencePrecision (self) |
| Inference precision corresponding to the engine data contained in the tool. | |
| int | EngineSetupDataBatchSize (self) |
| Batch size corresponding to the engine data contained in the tool. | |
| bool | OptimizeBatchSize (self) |
| Indicates whether to optimize the batch size (see eVision.EasyDeepLearning.EDeepLearningTool.BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory. | |
| OptimizeBatchSize (self, bool value) | |
| Indicates whether to optimize the batch size (see eVision.EasyDeepLearning.EDeepLearningTool.BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory. | |
| int | BatchSizeForMaximumInferenceSpeed (self) |
| Computes the batch size that will maximize the inference speed on NVIDIA GPU. | |
| int | BatchSize (self) |
| Batch size. | |
| BatchSize (self, int value) | |
| Batch size. | |
| float | CurrentTrainingProgression (self) |
| Current training progression as a percentage (between 0 and 1). | |
| int | CurrentTrainingFinishedIterations (self) |
| Number of iterations that are already finished in the current training. | |
| int | CurrentTrainingNumIterations (self) |
| Total number of training iterations that will be performed during the current training of the deep learning tool. | |
| int | NumTrainedIterations (self) |
| Number of iterations that were performed to train this deep learning tool. | |
| int | BestIteration (self) |
| Iteration at which the minimum validation error was reached. | |
| int | ImageCacheSize (self) |
| Size in byte of the image cache. | |
| ImageCacheSize (self, int value) | |
| Size in byte of the image cache. | |
| str | Path (self) |
| Path of the tool when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.Save or eVision.EasyDeepLearning.EDeepLearningTool.Load. | |
| str | InferenceModelPath (self) |
| Path of the inference model when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveInferenceModel, eVision.EasyDeepLearning.EDeepLearningTool.LoadInferenceModel or eVision.EasyDeepLearning.EDeepLearningTool.SerializeInferenceModel. | |
| str | TrainingModelPath (self) |
| Path of the training model when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveTrainingModel, eVision.EasyDeepLearning.EDeepLearningTool.LoadTrainingModel or eVision.EasyDeepLearning.EDeepLearningTool.SerializeTrainingModel. | |
| str | SettingsPath (self) |
| Path of the settings when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveSettings, eVision.EasyDeepLearning.EDeepLearningTool.LoadSettings or eVision.EasyDeepLearning.EDeepLearningTool.SerializeSettings. | |
| int | AutoSavePeriod (self) |
| Auto-save period. | |
| AutoSavePeriod (self, int value) | |
| Auto-save period. | |
| eVision.EasyDeepLearning.EDeepLearningLearningRateType | LearningRateType (self) |
| Learning rate type. | |
| list[float] | LearningRateParameters (self) |
| Parameters of the learning rate. | |
| bool | EnableDeterministicTraining (self) |
| Whether to use deterministic training algorithm that allows to repeatable training results. | |
| EnableDeterministicTraining (self, bool value) | |
| Whether to use deterministic training algorithm that allows to repeatable training results. | |
| int | DeterministicTrainingRandomSeed (self) |
| Random seed to use when eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining is set to true. | |
| DeterministicTrainingRandomSeed (self, int value) | |
| Random seed to use when eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining is set to true. | |
| int | NumLabels (self) |
| Number of labels of this tool. | |
Static Public Member Functions | |
| eVision.EasyDeepLearning.EDeepLearningTool|None | Create (str path) |
| Factory method to open a deep learning tool. | |
| eVision.EasyDeepLearning.EDeepLearningTool|None | Create (eVision.ESerializer|None serializer) |
| Factory method to open a deep learning tool. | |
| eVision.EasyDeepLearning.EDeepLearningTool|None | Create (eVision.EasyDeepLearning.EDeepLearningToolType type) |
| Factory method to open a deep learning tool. | |
| int | GetNumAvailableEngines () |
| Number of available engines. | |
| str | GetAvailableEngineName (int id) |
| Gets the name of the engine given its id. | |
| list[str] | GetAvailableEngines () |
| Available engines. | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | GetAvailableDevicesForEngine (str engine) |
| Available devices for the specified engine. | |
Protected Member Functions | |
| _ActiveDeviceByName__setter (self, str value) | |
| Sets the device with which to run the model using its name. | |
| _ActiveDeviceById__setter (self, int value) | |
| Sets the device with which to run the model using its index in the list returned by eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices. | |
| _ActiveDevicesById__setter (self, list[int] value) | |
| Sets the devices with which to run the model using their index in the list returned by eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices. | |
Properties | |
| ActiveDeviceByName | |
| ActiveDeviceById | |
| ActiveDevicesById | |
eVision.EasyDeepLearning.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 eVision.EasyDeepLearning.EClassifier).
Remarks:
License(s): EasyClassify or EasySegment or EasyLocate or EasyClassifyInference or EasySegmentInference or EasyLocateInference
|
protected |
Sets the device with which to run the model using its index in the list returned by eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices.
|
protected |
Sets the device with which to run the model using its name.
|
protected |
Sets the devices with which to run the model using their index in the list returned by eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices.
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] eVision.EasyDeepLearning.EDeepLearningTool.ActiveDevices | ( | self | ) |
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
| eVision.EasyDeepLearning.EDeepLearningTool.ActiveDevices | ( | self, | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | value ) |
Devices with which to run or train the model.
Only multiple GPUs with the default engine is supported.
| int eVision.EasyDeepLearning.EDeepLearningTool.AutoSavePeriod | ( | self | ) |
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 eVision.EasyDeepLearning.EDeepLearningTool.Path or the three paths eVision.EasyDeepLearning.EDeepLearningTool.SettingsPath, eVision.EasyDeepLearning.EDeepLearningTool.InferenceModelPath, and eVision.EasyDeepLearning.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.
| eVision.EasyDeepLearning.EDeepLearningTool.AutoSavePeriod | ( | self, | |
| int | value ) |
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 eVision.EasyDeepLearning.EDeepLearningTool.Path or the three paths eVision.EasyDeepLearning.EDeepLearningTool.SettingsPath, eVision.EasyDeepLearning.EDeepLearningTool.InferenceModelPath, and eVision.EasyDeepLearning.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.
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices | ( | self | ) |
Get all available device for the current engine.
| int eVision.EasyDeepLearning.EDeepLearningTool.BatchSize | ( | self | ) |
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 eVision.EasyDeepLearning.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.
Remarks:
If eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize is 'true', then the value of this property will be optimized automatically for training or inference according to the situation.
See also eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| eVision.EasyDeepLearning.EDeepLearningTool.BatchSize | ( | self, | |
| int | value ) |
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 eVision.EasyDeepLearning.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.
Remarks:
If eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize is 'true', then the value of this property will be optimized automatically for training or inference according to the situation.
See also eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| int eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed | ( | self | ) |
Computes the batch size that will maximize the inference speed on NVIDIA GPU.
For all other devices, it will return 1.
Remarks:
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.
| int eVision.EasyDeepLearning.EDeepLearningTool.BestIteration | ( | self | ) |
Iteration at which the minimum validation error was reached.
After training, the tool is in the state it was at this best iteration.
| None eVision.EasyDeepLearning.EDeepLearningTool.Clean | ( | self | ) |
Reset the engine and clean CPU and GPU memory allocated for running the model.
Remarks:
This method does not clean all GPU memory. For example, some program data (CUDA kernels) will be kept in GPU memory.
| None eVision.EasyDeepLearning.EDeepLearningTool.ClearEngineSetupData | ( | self | ) |
Clears the engine data saved in the inference model.
Use this method when your engine fails.
| eVision.EasyDeepLearning.EDeepLearningTool | None eVision.EasyDeepLearning.EDeepLearningTool.Clone | ( | self | ) |
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. |
| int eVision.EasyDeepLearning.EDeepLearningTool.CurrentTrainingFinishedIterations | ( | self | ) |
Number of iterations that are already finished in the current training.
| int eVision.EasyDeepLearning.EDeepLearningTool.CurrentTrainingNumIterations | ( | self | ) |
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 eVision.EasyDeepLearning.EDeepLearningTool.StopTraining).
| float eVision.EasyDeepLearning.EDeepLearningTool.CurrentTrainingProgression | ( | self | ) |
Current training progression as a percentage (between 0 and 1).
| int eVision.EasyDeepLearning.EDeepLearningTool.DeterministicTrainingRandomSeed | ( | self | ) |
Random seed to use when eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining is set to true.
The default value is 42.
When eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining, the random seed is generated using a random non-deterministic source.
| eVision.EasyDeepLearning.EDeepLearningTool.DeterministicTrainingRandomSeed | ( | self, | |
| int | value ) |
Random seed to use when eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining is set to true.
The default value is 42.
When eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining, the random seed is generated using a random non-deterministic source.
| bool eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining | ( | self | ) |
Whether to use deterministic training algorithm that allows to repeatable training results.
Default value: false.
Remarks:
Deterministic training is not guaranteed when:
| eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining | ( | self, | |
| bool | value ) |
Whether to use deterministic training algorithm that allows to repeatable training results.
Default value: false.
Remarks:
Deterministic training is not guaranteed when:
| bool eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU | ( | self | ) |
Enable the use of a GPU for training and inference of the deep learning tool.
If the active engine is not the default engine, eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU will be false even if the active device has a GPU device type. Setting eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU to any value when the active engine is not the default one will throw an exception.
| eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU | ( | self, | |
| bool | value ) |
Enable the use of a GPU for training and inference of the deep learning tool.
If the active engine is not the default engine, eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU will be false even if the active device has a GPU device type. Setting eVision.EasyDeepLearning.EDeepLearningTool.EnableGPU to any value when the active engine is not the default one will throw an exception.
| str eVision.EasyDeepLearning.EDeepLearningTool.Engine | ( | self | ) |
Sets the engine with which to execute or train the neural network.
| eVision.EasyDeepLearning.EDeepLearningTool.Engine | ( | self, | |
| str | value ) |
Sets the engine with which to execute or train the neural network.
| int eVision.EasyDeepLearning.EDeepLearningTool.EngineSetupDataBatchSize | ( | self | ) |
Batch size corresponding to the engine data contained in the tool.
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.EngineSetupDataDevice | ( | self | ) |
Device corresponding to the engine data contained in the tool.
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision eVision.EasyDeepLearning.EDeepLearningTool.EngineSetupDataInferencePrecision | ( | self | ) |
Inference precision corresponding to the engine data contained in the tool.
| eVision.EasyDeepLearning.EDeepLearningExecutionSettings eVision.EasyDeepLearning.EDeepLearningTool.ExecutionSettings | ( | self | ) |
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
| eVision.EasyDeepLearning.EDeepLearningTool.ExecutionSettings | ( | self, | |
| eVision.EasyDeepLearning.EDeepLearningExecutionSettings | value ) |
Execution settings of the tool (engine, device(s), inference precision, batch size settings).
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice | ( | self | ) |
Gets the active device.
By default, it returns the first active device.
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice | ( | self, | |
| int | i ) |
Gets the active device.
By default, it returns the first active device.
| i | Index of the active devices between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumActiveDevices. |
| eVision.EasyDeepLearning.EDeepLearningDevice eVision.EasyDeepLearning.EDeepLearningTool.GetAvailableDevice | ( | self, | |
| int | i ) |
i-th eVision.EasyDeepLearning.EDeepLearningDevice of the current engine.
| i | Index of the device between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumAvailableDevices - 1. |
| str eVision.EasyDeepLearning.EDeepLearningTool.GetAvailableDeviceName | ( | self, | |
| int | i ) |
Name of the i-th device of the current engine.
| i | Index of the device between 0 and eVision.EasyDeepLearning.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 eVision.EasyDeepLearning.EDeepLearningTool.GetNumAvailableEngines - 1. |
|
static |
Available engines.
| str eVision.EasyDeepLearning.EDeepLearningTool.GetLabel | ( | self, | |
| int | 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 | ( | self, | |
| int | 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 eVision.EasyDeepLearning.EDeepLearningTool.NumLabels |
| int eVision.EasyDeepLearning.EDeepLearningTool.GetLabelOpacity | ( | self, | |
| int | 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 eVision.EasyDeepLearning.EDeepLearningTool.NumLabels |
| float eVision.EasyDeepLearning.EDeepLearningTool.GetLabelWeight | ( | self, | |
| int | 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 |
|
static |
Number of available engines.
| int eVision.EasyDeepLearning.EDeepLearningTool.GetNumPatchesForImage | ( | self, | |
| 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 |
Reimplemented in eVision.EasyDeepLearning.ESupervisedSegmenter, and eVision.EasyDeepLearning.EUnsupervisedSegmenter.
| int eVision.EasyDeepLearning.EDeepLearningTool.GetNumPatchesForImage | ( | self, | |
| int | imageWidth, | ||
| int | imageHeight ) |
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 | ( | self, | |
| eVision.EBaseROI | sampleImage ) |
Optimal number of images to process together for inference given the batch size and eVision.EasyDeepLearning.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 | ( | self, | |
| int | imageWidth, | ||
| int | imageHeight ) |
Optimal number of images to process together for inference given the batch size and eVision.EasyDeepLearning.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 |
| list[int] eVision.EasyDeepLearning.EDeepLearningTool.GPUIndexes | ( | self | ) |
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.
Remarks:
The GPU are indexed from 0 to eVision.EasyDeepLearning.EDeepLearningTool.NumGPUs - 1.
Use eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice or eVision.EasyDeepLearning.EDeepLearningTool.ActiveDevices.
Deprecated in version 23.4. Scheduled to be removed in version 27.6.
| eVision.EasyDeepLearning.EDeepLearningTool.GPUIndexes | ( | self, | |
| list[int] | value ) |
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.
Remarks:
The GPU are indexed from 0 to eVision.EasyDeepLearning.EDeepLearningTool.NumGPUs - 1.
Use eVision.EasyDeepLearning.EDeepLearningTool.GetActiveDevice or eVision.EasyDeepLearning.EDeepLearningTool.ActiveDevices.
Deprecated in version 23.4. Scheduled to be removed in version 27.6.
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasEngineSetupData | ( | self | ) |
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 eVision.EasyDeepLearning.EDeepLearningTool.EngineSetupDataDevice, eVision.EasyDeepLearning.EDeepLearningTool.EngineSetupDataInferencePrecision, and eVision.EasyDeepLearning.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 eVision.EasyDeepLearning.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 eVision.EasyDeepLearning.EDeepLearningTool.ClearEngineSetupData.
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasInferenceModel | ( | self | ) |
Whether the inference model is loaded or created when the tool is not yet trained.
| bool eVision.EasyDeepLearning.EDeepLearningTool.HasTrainingModel | ( | self | ) |
Whether the training model is loaded or created when the tool is not yet trained.
| int eVision.EasyDeepLearning.EDeepLearningTool.ImageCacheSize | ( | self | ) |
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.
| eVision.EasyDeepLearning.EDeepLearningTool.ImageCacheSize | ( | self, | |
| int | value ) |
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.
| str eVision.EasyDeepLearning.EDeepLearningTool.InferenceModelPath | ( | self | ) |
Path of the inference model when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveInferenceModel, eVision.EasyDeepLearning.EDeepLearningTool.LoadInferenceModel or eVision.EasyDeepLearning.EDeepLearningTool.SerializeInferenceModel.
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision eVision.EasyDeepLearning.EDeepLearningTool.InferencePrecision | ( | self | ) |
Inference precision.
Use eVision.EasyDeepLearning.EDeepLearningDevice.IsPrecisionSupported to check whether a device support the given precision.
| eVision.EasyDeepLearning.EDeepLearningTool.InferencePrecision | ( | self, | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | value ) |
Inference precision.
Use eVision.EasyDeepLearning.EDeepLearningDevice.IsPrecisionSupported to check whether a device support the given precision.
| None eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | self, | |
| 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 eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize is equal to true, the value of eVision.EasyDeepLearning.EDeepLearningTool.BatchSize will be recomputed.
| img | Image for which to prepare the tool for inference |
| None eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | self, | |
| 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 eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize is equal to true, the value of eVision.EasyDeepLearning.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 |
| None eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference | ( | self, | |
| list[eVision._eVision.EBaseROI | None] | 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 eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize is equal to true, the value of eVision.EasyDeepLearning.EDeepLearningTool.BatchSize will be recomputed.
| imgList | Vector of images for which to prepare the tool for inference |
| bool eVision.EasyDeepLearning.EDeepLearningTool.IsTrained | ( | self | ) |
Tells whether the deep learning tool has been trained.
| bool eVision.EasyDeepLearning.EDeepLearningTool.IsTraining | ( | self | ) |
Indicates whether the object is currently training.
| list[float] eVision.EasyDeepLearning.EDeepLearningTool.LearningRateParameters | ( | self | ) |
Parameters of the learning rate.
| eVision.EasyDeepLearning.EDeepLearningLearningRateType eVision.EasyDeepLearning.EDeepLearningTool.LearningRateType | ( | self | ) |
Learning rate type.
| None eVision.EasyDeepLearning.EDeepLearningTool.Load | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Loads a deep learning tool.
The given eVision.ESerializer must have been created for reading.
| serializer | Pointer to the eVision.ESerializer created for reading. |
| None eVision.EasyDeepLearning.EDeepLearningTool.Load | ( | self, | |
| str | filePath ) |
Loads a deep learning tool.
The given eVision.ESerializer must have been created for reading.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.LoadInferenceModel | ( | self, | |
| str | filePath ) |
Loads the tool's inference model.
The inference model is required to apply the tool on new images.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.LoadSettings | ( | self, | |
| str | filePath ) |
Loads the settings of a tool.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.LoadTrainingModel | ( | self, | |
| str | filePath ) |
Loads the tool's training model.
The training model is required to continue a training.
| filePath | File path. |
| int eVision.EasyDeepLearning.EDeepLearningTool.NumActiveDevices | ( | self | ) |
Gets the number of devices with which to run or train the model.
| int eVision.EasyDeepLearning.EDeepLearningTool.NumAvailableDevices | ( | self | ) |
Available devices for the current eVision.EasyDeepLearning.EDeepLearningTool.Engine.
| int eVision.EasyDeepLearning.EDeepLearningTool.NumGPUs | ( | self | ) |
Number of detected NVIDIA GPU.
Use eVision.EasyDeepLearning.EDeepLearningTool.NumAvailableDevices or parse the output of eVision.EasyDeepLearning.EDeepLearningTool.AvailableDevices to find the devices that are GPUs.
Deprecated in version 23.4. Scheduled to be removed in version 27.6.
| int eVision.EasyDeepLearning.EDeepLearningTool.NumLabels | ( | self | ) |
Number of labels of this tool.
If the tool is not trained, the method will throw an exception.
Remarks:
Some type of tools such as eVision.EasyDeepLearning.EUnsupervisedSegmenter may have no label at all. For these tools, there is a separate API to control the predicted labels.
| int eVision.EasyDeepLearning.EDeepLearningTool.NumTrainedIterations | ( | self | ) |
Number of iterations that were performed to train this deep learning tool.
Remarks:
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.
| bool eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize | ( | self | ) |
Indicates whether to optimize the batch size (see eVision.EasyDeepLearning.EDeepLearningTool.BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
Default value is true.
Remarks:
The batch size will be optimized at the start of training or during eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference.
| eVision.EasyDeepLearning.EDeepLearningTool.OptimizeBatchSize | ( | self, | |
| bool | value ) |
Indicates whether to optimize the batch size (see eVision.EasyDeepLearning.EDeepLearningTool.BatchSize) to maximize the training and inference speed according to the engine, the device and the available memory.
Default value is true.
Remarks:
The batch size will be optimized at the start of training or during eVision.EasyDeepLearning.EDeepLearningTool.InitializeInference.
| str eVision.EasyDeepLearning.EDeepLearningTool.Path | ( | self | ) |
Path of the tool when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.Save or eVision.EasyDeepLearning.EDeepLearningTool.Load.
| None eVision.EasyDeepLearning.EDeepLearningTool.Save | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Saves the settings, inference and training model of the deep learning tool.
The given eVision.ESerializer must have been created for writing.
| serializer | Pointer to the eVision.ESerializer created for writing. |
| None eVision.EasyDeepLearning.EDeepLearningTool.Save | ( | self, | |
| eVision.ESerializer | None | serializer, | ||
| bool | includeTrainingModel ) |
Saves the settings, inference and training model of the deep learning tool.
The given eVision.ESerializer must have been created for writing.
| serializer | Pointer to the eVision.ESerializer created for writing. |
| includeTrainingModel | Whether to save the training model. The training model is required to continue training the tool. |
| None eVision.EasyDeepLearning.EDeepLearningTool.Save | ( | self, | |
| str | filePath ) |
Saves the settings, inference and training model of the deep learning tool.
The given eVision.ESerializer must have been created for writing.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.Save | ( | self, | |
| str | filePath, | ||
| bool | includeTrainingModel ) |
Saves the settings, inference and training model of the deep learning tool.
The given eVision.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. |
| None eVision.EasyDeepLearning.EDeepLearningTool.SaveInferenceModel | ( | self, | |
| str | filePath ) |
Saves the tool's inference model to a file.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.SaveSettings | ( | self, | |
| str | filePath ) |
Saves the settings of the tool to a file.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.SaveTrainingModel | ( | self, | |
| str | filePath ) |
Saves the tool's training model to a file.
| filePath | File path. |
| None eVision.EasyDeepLearning.EDeepLearningTool.SerializeInferenceModel | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Serializes the inference model of the tool.
| serializer | Pointer to eVision.ESerializer |
| None eVision.EasyDeepLearning.EDeepLearningTool.SerializeSettings | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Serializes the tool settings.
| serializer | Pointer to eVision.ESerializer |
Reimplemented in eVision.EasyDeepLearning.EClassifier, eVision.EasyDeepLearning.EDeepOCRTool, eVision.EasyDeepLearning.EInterestPointLocator, eVision.EasyDeepLearning.ELocator, eVision.EasyDeepLearning.ELocatorBase, eVision.EasyDeepLearning.ESupervisedSegmenter, and eVision.EasyDeepLearning.EUnsupervisedSegmenter.
| None eVision.EasyDeepLearning.EDeepLearningTool.SerializeTrainingModel | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Serializes the training model of the tool.
The training model is necessary to continue training the tool.
| serializer | Pointer to eVision.ESerializer |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetActiveDevice | ( | self, | |
| eVision.EasyDeepLearning.EDeepLearningDevice | device ) |
Sets the device with which to run or train the model.
Remarks:
For CPU device, the number of thread is initialized from eVision.Easy.SetMaxNumberOfProcessingThreads.
Note that this can change eVision.EasyDeepLearning.EDeepLearningTool.InferencePrecision if the previously set value was incompatible with the device.
| device | The device with which to run or train the model. |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetLabel | ( | self, | |
| int | index, | ||
| str | label ) |
Changes a label predicted by the tool.
Remarks:
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 eVision.EasyDeepLearning.EUnsupervisedSegmenter uses eVision.EasyDeepLearning.EUnsupervisedSegmenter.GoodLabel instead.
| index | Index of the label |
| label | New label |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetLabelColor | ( | self, | |
| int | index, | ||
| eVision.ERGBColor | c ) |
Changes a label color.
| index | Index of the label between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumLabels |
| c | New color for the specified label |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetLabelOpacity | ( | self, | |
| int | index, | ||
| int | opacity ) |
Changes a label opacity (between 0 for fully transparent and 255 for opaque color).
| index | Index of the label between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumLabels |
| opacity | New opacity for the specified label |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetLabelWeight | ( | self, | |
| int | 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 |
| None eVision.EasyDeepLearning.EDeepLearningTool.SetLearningRate | ( | self, | |
| eVision.EasyDeepLearning.EDeepLearningLearningRateType | type, | ||
| list[float] | parameters ) |
Specifies how the value of the learning rate and how it evolves during training.
| str eVision.EasyDeepLearning.EDeepLearningTool.SettingsPath | ( | self | ) |
Path of the settings when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveSettings, eVision.EasyDeepLearning.EDeepLearningTool.LoadSettings or eVision.EasyDeepLearning.EDeepLearningTool.SerializeSettings.
| int eVision.EasyDeepLearning.EDeepLearningTool.StopTraining | ( | self, | |
| 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 |
| eVision.EasyDeepLearning.EDeepLearningToolType eVision.EasyDeepLearning.EDeepLearningTool.ToolType | ( | self | ) |
Type of the deep learning tool.
Reimplemented in eVision.EasyDeepLearning.EClassifier, eVision.EasyDeepLearning.EDeepOCRTool, eVision.EasyDeepLearning.EInterestPointLocator, eVision.EasyDeepLearning.ELocator, eVision.EasyDeepLearning.ESupervisedSegmenter, and eVision.EasyDeepLearning.EUnsupervisedSegmenter.
| str eVision.EasyDeepLearning.EDeepLearningTool.TrainingModelPath | ( | self | ) |
Path of the training model when loaded or saved using eVision.EasyDeepLearning.EDeepLearningTool.SaveTrainingModel, eVision.EasyDeepLearning.EDeepLearningTool.LoadTrainingModel or eVision.EasyDeepLearning.EDeepLearningTool.SerializeTrainingModel.
| None eVision.EasyDeepLearning.EDeepLearningTool.UnloadInferenceModel | ( | self | ) |
Unloads the inference model.
| None eVision.EasyDeepLearning.EDeepLearningTool.UnloadModels | ( | self | ) |
Unloads the inference and training model.
| None eVision.EasyDeepLearning.EDeepLearningTool.UnloadTrainingModel | ( | self | ) |
Unloads the training model.
| int eVision.EasyDeepLearning.EDeepLearningTool.WaitForIterationCompletion | ( | self | ) |
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 | ( | self | ) |
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 | ( | self, | |
| 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 |
|
static |
|
static |
|
static |