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


Public Member Functions | |
| None | __init__ (self) |
| Constructs a eVision.EasyDeepLearning.EClassifier object. | |
| None | __init__ (self, eVision.EasyDeepLearning.EClassifier other) |
| Copy constructor of a eVision.EasyDeepLearning.EClassifier object. | |
| None | SerializeSettings (self, eVision.ESerializer|None serializer) |
| Serializes the classifier settings. | |
| None | LoadAsPretrained (self, str path) |
| Loads the classifier and use it as a pre-trained model. | |
| None | LoadOnnxModelAsPretrained (self, str path) |
| Loads the ONNX model as a pre-trained model. | |
| None | LoadOnnxModel (self, str path) |
| Loads the ONNX model for inference. | |
| bool | HasPretrainedModel (self) |
| Whether a pre-trained model for the current configuration can be found. | |
| eVision.EasyDeepLearning.EClassificationMetrics | GetTrainingMetrics (self, int id) |
| Gets the metrics obtained with the training dataset at the given iteration. | |
| eVision.EasyDeepLearning.EClassificationMetrics | GetValidationMetrics (self, int id) |
| Gets the metrics obtained with the validation dataset at the given iteration. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset dataset) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset dataset, eVision.EasyDeepLearning.EDataAugmentation dataAugmentation) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset trainingDataset, eVision.EasyDeepLearning.EDataset validationDataset) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset trainingDataset, eVision.EasyDeepLearning.EDataset validationDataset, eVision.EasyDeepLearning.EDataAugmentation dataAugmentation) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset dataset, int iterations) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset dataset, eVision.EasyDeepLearning.EDataAugmentation dataAugmentation, int iterations) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset trainingDataset, eVision.EasyDeepLearning.EDataset validationDataset, int iterations) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| None | Train (self, eVision.EasyDeepLearning.EDataset trainingDataset, eVision.EasyDeepLearning.EDataset validationDataset, eVision.EasyDeepLearning.EDataAugmentation dataAugmentation, int iterations) |
| Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations. | |
| eVision.EasyDeepLearning.EClassificationResult | Classify (self, eVision.EBaseROI img) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| eVision.EasyDeepLearning.EClassificationResult | Classify (self, eVision.EBaseROI img, eVision.ERegion mask) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] | Classify (self, list[eVision._eVision.EBaseROI|None] imgList, eVision.ERegion mask) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] | Classify (self, list[eVision._eVision.EBaseROI|None] imgList) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| eVision.EasyDeepLearning.EClassificationResult | Classify (self, eVision.EBaseROI img, eVision.ERegion mask, eVision.EFrame frame) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] | Classify (self, list[eVision._eVision.EBaseROI|None] imgList, eVision.ERegion mask, eVision.EFrame frame) |
| Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object. | |
| eVision.EasyDeepLearning.EClassificationMetrics | Evaluate (self, eVision.EasyDeepLearning.EDataset dataset) |
| Evaluates the eVision.EasyDeepLearning.EClassifier using the given eVision.EasyDeepLearning.EDataset. | |
| eVision.EImageBW8 | GetHeatMap (self, eVision.EBaseROI image, str label) |
| Gets a heatmap associated with the given label. | |
| eVision.EImageC24 | GetColorizedHeatMap (self, eVision.EBaseROI image, str label) |
| Gets a colorized heatmap associated with the given label. | |
| eVision.EImageC24A | GetColorizedHeatmapWithTransparency (self, eVision.EBaseROI image, str label, float minAlpha, float maxAlpha, eVision.EasyDeepLearning.EHeatmapColormap colormap) |
| Colorized heatmap with transparency. | |
| eVision.EImageC24A | GetColorizedHeatmapWithTransparency (self, eVision.EBaseROI image, str label, float minAlpha, float maxAlpha) |
| Colorized heatmap with transparency. | |
| None | LearnOODParameters (self, eVision.EasyDeepLearning.EDataset trainList, eVision.EasyDeepLearning.EDataset valList) |
| Learns OOD parameters using training data. | |
| None | LearnOODParameters (self, list[eVision._eVision.EBaseROI|None] trainList, list[eVision._eVision.EBaseROI|None] valList) |
| Learns OOD parameters using training data. | |
| bool | HasOODParameters (self) |
| Checks whether the OOD parameters have been learned. | |
| Public Member Functions inherited from eVision.EasyDeepLearning.EDeepLearningTool | |
| 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 | 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. | |
Static Public Member Functions | |
| str | GetAvailableModelTypes (int i) |
| Get the i-th available models to be used with eVision.EasyDeepLearning.EClassifier.ModelType. | |
| int | GetNumAvailableModelTypes () |
| Number of available models for training an EasyClassify tool. | |
| Static Public Member Functions inherited from eVision.EasyDeepLearning.EDeepLearningTool | |
| 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 | |
| eVision.EasyDeepLearning.EDeepLearningToolType | _ToolType__getter (self) |
| \cond | |
| bool | _UsePretrainedModel__getter (self) |
| \cond | |
| _UsePretrainedModel__setter (self, bool value) | |
| Whether to use a pre-trained model when training. | |
| int | _Width__getter (self) |
| \cond | |
| _Width__setter (self, int value) | |
| Width for input images of the classifier. | |
| int | _Height__getter (self) |
| \cond | |
| _Height__setter (self, int value) | |
| Height for input images of the classifier. | |
| int | _Channels__getter (self) |
| \cond | |
| _Channels__setter (self, int value) | |
| Number of channels for input images of the classifier. | |
| bool | _EnableAutomaticImageReformat__getter (self) |
| \cond | |
| _EnableAutomaticImageReformat__setter (self, bool value) | |
| Enable automatic image reformat (true by default). | |
| bool | _EnableHistogramEqualization__getter (self) |
| \cond | |
| _EnableHistogramEqualization__setter (self, bool value) | |
| Enable histogram equalization of all images passing through the classifier. | |
| int | _MinimumWidth__getter (self) |
| \cond | |
| int | _MinimumHeight__getter (self) |
| \cond | |
| eVision.EasyDeepLearning.EClassifierCapacity | _Capacity__getter (self) |
| \cond | |
| _Capacity__setter (self, eVision.EasyDeepLearning.EClassifierCapacity value) | |
| Capacity of classifier to use. | |
| str | _ModelType__getter (self) |
| \cond | |
| _ModelType__setter (self, str value) | |
| Model type for training. | |
| float | _OODThreshold__getter (self) |
| \cond | |
| _OODThreshold__setter (self, float value) | |
| Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD. | |
| bool | _ComputeHeatmapWithResult__getter (self) |
| \cond | |
| _ComputeHeatmapWithResult__setter (self, bool value) | |
| Whether to always compute the heatmap along the result when applying the tool. | |
| bool | _ComputeOODWithResult__getter (self) |
| \cond | |
| _ComputeOODWithResult__setter (self, bool value) | |
| Whether to compute the OOD parameters while training. | |
| Protected Member Functions inherited from eVision.EasyDeepLearning.EDeepLearningTool | |
| bool | _EnableGPU__getter (self) |
| \cond | |
| _EnableGPU__setter (self, bool value) | |
| Enable the use of a GPU for training and inference of the deep learning tool. | |
| list[int] | _GPUIndexes__getter (self) |
| \cond | |
| _GPUIndexes__setter (self, list[int] value) | |
| Indexes of the GPUs to use for computations. | |
| int | _NumGPUs__getter (self) |
| \cond | |
| str | _Engine__getter (self) |
| \cond | |
| _Engine__setter (self, str value) | |
| Sets the engine with which to execute or train the neural network. | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | _InferencePrecision__getter (self) |
| \cond | |
| _InferencePrecision__setter (self, eVision.EasyDeepLearning.EDeepLearningInferencePrecision value) | |
| Inference precision. | |
| int | _NumAvailableDevices__getter (self) |
| \cond | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | _AvailableDevices__getter (self) |
| \cond | |
| int | _NumActiveDevices__getter (self) |
| \cond | |
| _ActiveDeviceByName__setter (self, str value) | |
| \cond | |
| _ActiveDeviceById__setter (self, int value) | |
| \cond | |
| list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] | _ActiveDevices__getter (self) |
| \cond | |
| _ActiveDevices__setter (self, list[eVision._eVision.EasyDeepLearning.EDeepLearningDevice] value) | |
| Devices with which to run or train the model. | |
| _ActiveDevicesById__setter (self, list[int] value) | |
| \cond | |
| eVision.EasyDeepLearning.EDeepLearningExecutionSettings | _ExecutionSettings__getter (self) |
| \cond | |
| _ExecutionSettings__setter (self, eVision.EasyDeepLearning.EDeepLearningExecutionSettings value) | |
| Execution settings of the tool (engine, device(s), inference precision, batch size settings). | |
| eVision.EasyDeepLearning.EDeepLearningDevice | _EngineSetupDataDevice__getter (self) |
| \cond | |
| eVision.EasyDeepLearning.EDeepLearningInferencePrecision | _EngineSetupDataInferencePrecision__getter (self) |
| \cond | |
| int | _EngineSetupDataBatchSize__getter (self) |
| \cond | |
| bool | _OptimizeBatchSize__getter (self) |
| \cond | |
| _OptimizeBatchSize__setter (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__getter (self) |
| \cond | |
| int | _BatchSize__getter (self) |
| \cond | |
| _BatchSize__setter (self, int value) | |
| Batch size. | |
| float | _CurrentTrainingProgression__getter (self) |
| \cond | |
| int | _CurrentTrainingFinishedIterations__getter (self) |
| \cond | |
| int | _CurrentTrainingNumIterations__getter (self) |
| \cond | |
| int | _NumTrainedIterations__getter (self) |
| \cond | |
| int | _BestIteration__getter (self) |
| \cond | |
| int | _ImageCacheSize__getter (self) |
| \cond | |
| _ImageCacheSize__setter (self, int value) | |
| Size in byte of the image cache. | |
| str | _Path__getter (self) |
| \cond | |
| str | _InferenceModelPath__getter (self) |
| \cond | |
| str | _TrainingModelPath__getter (self) |
| \cond | |
| str | _SettingsPath__getter (self) |
| \cond | |
| int | _AutoSavePeriod__getter (self) |
| \cond | |
| _AutoSavePeriod__setter (self, int value) | |
| Auto-save period. | |
| eVision.EasyDeepLearning.EDeepLearningLearningRateType | _LearningRateType__getter (self) |
| \cond | |
| list[float] | _LearningRateParameters__getter (self) |
| \cond | |
| bool | _EnableDeterministicTraining__getter (self) |
| \cond | |
| _EnableDeterministicTraining__setter (self, bool value) | |
| Whether to use deterministic training algorithm that allows to repeatable training results. | |
| int | _DeterministicTrainingRandomSeed__getter (self) |
| \cond | |
| _DeterministicTrainingRandomSeed__setter (self, int value) | |
| Random seed to use when eVision.EasyDeepLearning.EDeepLearningTool.EnableDeterministicTraining is set to true. | |
| int | _NumLabels__getter (self) |
| \cond | |
eVision.EasyDeepLearning.EClassifier allows to train a classifier using an eVision.EasyDeepLearning.EDataset object and classify new images.
As required by Deep Learning techniques, the input image of eVision.EasyDeepLearning.EClassifier must be of the same format (width, height, number of channels). By default, this format will be 224x224xC (which is the format used for pre-training our networks) with C being the number of channel of the first image of the dataset. The format can also be specified by the eVision.EasyDeepLearning.EClassifier.Width, eVision.EasyDeepLearning.EClassifier.Height and eVision.EasyDeepLearning.EClassifier.Channels unless its width and height is smaller than the minimum width and height supported by the classifier. In this case, the input resolution will be the minimum resolution supported by the classifier. (See eVision.EasyDeepLearning.EClassifier.MinimumWidth and eVision.EasyDeepLearning.EClassifier.MinimumHeight). methods.
By default, images that don't satisfy the image format of the classifier are automatically reformatted. This behavior can be controlled through the eVision.EasyDeepLearning.EClassifier.EnableAutomaticImageReformat method. When the automatic image reformatting is disabled, training or classifying an image that doesn't satisfy the input image format will result in an exception.
Once trained, the input image format cannot be changed.
Remarks:
License(s): EasyClassify or EasyClassifyInference
| None eVision.EasyDeepLearning.EClassifier.__init__ | ( | self | ) |
Constructs a eVision.EasyDeepLearning.EClassifier object.
| None eVision.EasyDeepLearning.EClassifier.__init__ | ( | self, | |
| eVision.EasyDeepLearning.EClassifier | other ) |
Copy constructor of a eVision.EasyDeepLearning.EClassifier object.
| other | Reference to the eVision.EasyDeepLearning.EClassifier object that should be copied |
|
protected |
\cond
Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).
|
protected |
Capacity of classifier to use.
Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).
|
protected |
\cond
Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
protected |
Number of channels for input images of the classifier.
The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
protected |
\cond
Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through eVision.EasyDeepLearning.EClassificationResult.Heatmap.
|
protected |
Whether to always compute the heatmap along the result when applying the tool.
If true, the heatmap is available through eVision.EasyDeepLearning.EClassificationResult.Heatmap.
|
protected |
\cond
Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through eVision.EasyDeepLearning.EClassificationResult.OODScore.
|
protected |
Whether to compute the OOD parameters while training.
Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through eVision.EasyDeepLearning.EClassificationResult.OODScore.
|
protected |
\cond
Enable automatic image reformat (true by default).
|
protected |
Enable automatic image reformat (true by default).
|
protected |
\cond
Enable histogram equalization of all images passing through the classifier. (false by default)
|
protected |
Enable histogram equalization of all images passing through the classifier.
(false by default)
|
protected |
\cond
Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
protected |
Height for input images of the classifier.
By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
protected |
\cond
Minimum height for input images of the classifier. This value is equal to 1 for standard networks.
|
protected |
\cond
Minimum width for input images of the classifier. This value is equal to 1 for standard networks.
|
protected |
\cond
Model type for training. Default: "Normal".
The list of available models is available through eVision.EasyDeepLearning.EClassifier.GetAvailableModelTypes.
|
protected |
Model type for training.
Default: "Normal".
The list of available models is available through eVision.EasyDeepLearning.EClassifier.GetAvailableModelTypes.
|
protected |
\cond
Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.
Remarks:
If training has been carried out with eVision.EasyDeepLearning.EClassifier.ComputeOODWithResult set to True, the parameters have been automatically initialized. Otherwise, call eVision.EasyDeepLearning.EClassifier.LearnOODParameters with the training data before calling this method.
The OOD threshold is automatically initialized during learning. If needed, the parameter can also be changed manually.
|
protected |
Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.
Remarks:
If training has been carried out with eVision.EasyDeepLearning.EClassifier.ComputeOODWithResult set to True, the parameters have been automatically initialized. Otherwise, call eVision.EasyDeepLearning.EClassifier.LearnOODParameters with the training data before calling this method.
The OOD threshold is automatically initialized during learning. If needed, the parameter can also be changed manually.
|
protected |
\cond
Type of the deep learning tool.
Reimplemented from eVision.EasyDeepLearning.EDeepLearningTool.
|
protected |
\cond
Whether to use a pre-trained model when training.
Default: true if the pre-trained model are found on the disk.
|
protected |
Whether to use a pre-trained model when training.
Default: true if the pre-trained model are found on the disk.
|
protected |
\cond
Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
protected |
Width for input images of the classifier.
By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
| eVision.EasyDeepLearning.EClassificationResult eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| eVision.EBaseROI | img ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| img | Image to classify |
| eVision.EasyDeepLearning.EClassificationResult eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| eVision.EBaseROI | img, | ||
| eVision.ERegion | mask ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| img | Image to classify |
| mask | Mask of image to classify |
| eVision.EasyDeepLearning.EClassificationResult eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| eVision.EBaseROI | img, | ||
| eVision.ERegion | mask, | ||
| eVision.EFrame | frame ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| img | Image to classify |
| mask | Mask of image to classify |
| frame | Frame associated with the mask. |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| list[eVision._eVision.EBaseROI | None] | imgList ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| imgList | Vector of images to classify |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| list[eVision._eVision.EBaseROI | None] | imgList, | ||
| eVision.ERegion | mask ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| imgList | Vector of images to classify |
| mask | Mask of image to classify |
| list[eVision._eVision.EasyDeepLearning.EClassificationResult] eVision.EasyDeepLearning.EClassifier.Classify | ( | self, | |
| list[eVision._eVision.EBaseROI | None] | imgList, | ||
| eVision.ERegion | mask, | ||
| eVision.EFrame | frame ) |
Classifies images and returns the complete results as an eVision.EasyDeepLearning.EClassificationResult object.
The method throws an exception if the input image does not fulfill the input specification.
Remarks:
Classifying a set of images is usually faster than classifying each image sequentially.
To maximize the classification speed on a GPU, eVision.EasyDeepLearning.EDeepLearningTool.BatchSize and the size of the set of input images must be equal to the value returned by eVision.EasyDeepLearning.EDeepLearningTool.BatchSizeForMaximumInferenceSpeed.
| imgList | Vector of images to classify |
| mask | Mask of image to classify |
| frame | Frame associated with the mask. |
| eVision.EasyDeepLearning.EClassificationMetrics eVision.EasyDeepLearning.EClassifier.Evaluate | ( | self, | |
| eVision.EasyDeepLearning.EDataset | dataset ) |
Evaluates the eVision.EasyDeepLearning.EClassifier using the given eVision.EasyDeepLearning.EDataset.
Remarks:
This method computes various metrics (see eVision.EasyDeepLearning.EClassificationMetrics on the given dataset.
The method ignores the label weights and the data augmentation settings of the given dataset. However, the label weights can be taken into consideration in the returned eVision.EasyDeepLearning.EClassificationMetrics object.
License(s): EasyClassify
| dataset | eVision.EasyDeepLearning.EDataset with which to evaluate the classifier |
|
static |
Get the i-th available models to be used with eVision.EasyDeepLearning.EClassifier.ModelType.
| i | Index of the model between 0 and eVision.EasyDeepLearning.EClassifier.GetNumAvailableModelTypes - 1. |
| eVision.EImageC24 eVision.EasyDeepLearning.EClassifier.GetColorizedHeatMap | ( | self, | |
| eVision.EBaseROI | image, | ||
| str | label ) |
Gets a colorized heatmap associated with the given label.
A heatmap is an image that indicates which pixels in the original image best explain the given label.
| image | A reference to the image we want to generate the heatmap from. |
| label | A reference to the string representing the label we want to explain for the given image. |
| eVision.EImageC24A eVision.EasyDeepLearning.EClassifier.GetColorizedHeatmapWithTransparency | ( | self, | |
| eVision.EBaseROI | image, | ||
| str | label, | ||
| float | minAlpha, | ||
| float | maxAlpha ) |
Colorized heatmap with transparency.
When the minimum and maximum alpha values are different from each other, the transparency value for a pixel will depend on the value of the heatmap at that pixel. The range of heatmap values [0, 255] will be mapped to the range [minAlpha, maxAlpha].
| image | A reference to the image we want to generate the heatmap from. |
| label | A reference to the string representing the label we want to explain for the given image. |
| minAlpha | Minimum transparency value. |
| maxAlpha | Maximum transparency value. |
| eVision.EImageC24A eVision.EasyDeepLearning.EClassifier.GetColorizedHeatmapWithTransparency | ( | self, | |
| eVision.EBaseROI | image, | ||
| str | label, | ||
| float | minAlpha, | ||
| float | maxAlpha, | ||
| eVision.EasyDeepLearning.EHeatmapColormap | colormap ) |
Colorized heatmap with transparency.
When the minimum and maximum alpha values are different from each other, the transparency value for a pixel will depend on the value of the heatmap at that pixel. The range of heatmap values [0, 255] will be mapped to the range [minAlpha, maxAlpha].
| image | A reference to the image we want to generate the heatmap from. |
| label | A reference to the string representing the label we want to explain for the given image. |
| minAlpha | Minimum transparency value. |
| maxAlpha | Maximum transparency value. |
| colormap | Color map |
| eVision.EImageBW8 eVision.EasyDeepLearning.EClassifier.GetHeatMap | ( | self, | |
| eVision.EBaseROI | image, | ||
| str | label ) |
Gets a heatmap associated with the given label.
A heatmap is an image that indicates which pixels in the original image best explain the given label.
| image | A reference to the image we want to generate the heatmap from. |
| label | A reference to the string representing the label we want to explain for the given image. |
|
static |
Number of available models for training an EasyClassify tool.
| eVision.EasyDeepLearning.EClassificationMetrics eVision.EasyDeepLearning.EClassifier.GetTrainingMetrics | ( | self, | |
| int | id ) |
Gets the metrics obtained with the training dataset at the given iteration.
The iterations are indexed between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumTrainedIterations - 1.
| id | The iteration index |
| eVision.EasyDeepLearning.EClassificationMetrics eVision.EasyDeepLearning.EClassifier.GetValidationMetrics | ( | self, | |
| int | id ) |
Gets the metrics obtained with the validation dataset at the given iteration.
The iterations are indexed between 0 and eVision.EasyDeepLearning.EDeepLearningTool.NumTrainedIterations - 1.
| id | The iteration index |
| bool eVision.EasyDeepLearning.EClassifier.HasOODParameters | ( | self | ) |
Checks whether the OOD parameters have been learned.
| bool eVision.EasyDeepLearning.EClassifier.HasPretrainedModel | ( | self | ) |
Whether a pre-trained model for the current configuration can be found.
| None eVision.EasyDeepLearning.EClassifier.LearnOODParameters | ( | self, | |
| eVision.EasyDeepLearning.EDataset | trainList, | ||
| eVision.EasyDeepLearning.EDataset | valList ) |
Learns OOD parameters using training data.
The dataset must correspond to the dataset used to train the classifier.
| trainList | List of images used for training the EClassifier. |
| valList | List of images used as validation during the training of the EClassifier. |
| None eVision.EasyDeepLearning.EClassifier.LearnOODParameters | ( | self, | |
| list[eVision._eVision.EBaseROI | None] | trainList, | ||
| list[eVision._eVision.EBaseROI | None] | valList ) |
Learns OOD parameters using training data.
The dataset must correspond to the dataset used to train the classifier.
| trainList | List of images used for training the EClassifier. |
| valList | List of images used as validation during the training of the EClassifier. |
| None eVision.EasyDeepLearning.EClassifier.LoadAsPretrained | ( | self, | |
| str | path ) |
Loads the classifier and use it as a pre-trained model.
| path | Path to the pre-trained model. |
| None eVision.EasyDeepLearning.EClassifier.LoadOnnxModel | ( | self, | |
| str | path ) |
Loads the ONNX model for inference.
The methods will automatically create labels according to the number of classes in the ONNX model. The labels are named according to their position, i.e. "0", "1", etc. You can change the labels afterward using the method eVision.EasyDeepLearning.EDeepLearningTool.SetLabel.
| None eVision.EasyDeepLearning.EClassifier.LoadOnnxModelAsPretrained | ( | self, | |
| str | path ) |
Loads the ONNX model as a pre-trained model.
This method loads the architecture of the neural network as well as the trained weights in the model but discards the weights and parameters of some of the last layers to allow retraining on a new dataset with a different number of labels.
| None eVision.EasyDeepLearning.EClassifier.SerializeSettings | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Serializes the classifier settings.
| serializer | Pointer to eVision.ESerializer |
Reimplemented from eVision.EasyDeepLearning.EDeepLearningTool.
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | dataset ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| dataset | eVision.EasyDeepLearning.EDataset with which to train and validate the deep learning tool |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | dataset, | ||
| eVision.EasyDeepLearning.EDataAugmentation | dataAugmentation ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| dataset | eVision.EasyDeepLearning.EDataset with which to train and validate the deep learning tool |
| dataAugmentation | Data augmentation to use during training |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | dataset, | ||
| eVision.EasyDeepLearning.EDataAugmentation | dataAugmentation, | ||
| int | iterations ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| dataset | eVision.EasyDeepLearning.EDataset with which to train and validate the deep learning tool |
| dataAugmentation | Data augmentation to use during training |
| iterations | Number of iterations for training. |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | dataset, | ||
| int | iterations ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| dataset | eVision.EasyDeepLearning.EDataset with which to train and validate the deep learning tool |
| iterations | Number of iterations for training. |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | trainingDataset, | ||
| eVision.EasyDeepLearning.EDataset | validationDataset ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| trainingDataset | eVision.EasyDeepLearning.EDataset with which to train the deep learning tool |
| validationDataset | eVision.EasyDeepLearning.EDataset with which to validate the deep learning tool |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | trainingDataset, | ||
| eVision.EasyDeepLearning.EDataset | validationDataset, | ||
| eVision.EasyDeepLearning.EDataAugmentation | dataAugmentation ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| trainingDataset | eVision.EasyDeepLearning.EDataset with which to train the deep learning tool |
| validationDataset | eVision.EasyDeepLearning.EDataset with which to validate the deep learning tool |
| dataAugmentation | Data augmentation to use during training |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | trainingDataset, | ||
| eVision.EasyDeepLearning.EDataset | validationDataset, | ||
| eVision.EasyDeepLearning.EDataAugmentation | dataAugmentation, | ||
| int | iterations ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| trainingDataset | eVision.EasyDeepLearning.EDataset with which to train the deep learning tool |
| validationDataset | eVision.EasyDeepLearning.EDataset with which to validate the deep learning tool |
| dataAugmentation | Data augmentation to use during training |
| iterations | Number of iterations for training. |
| None eVision.EasyDeepLearning.EClassifier.Train | ( | self, | |
| eVision.EasyDeepLearning.EDataset | trainingDataset, | ||
| eVision.EasyDeepLearning.EDataset | validationDataset, | ||
| int | iterations ) |
Trains the eVision.EasyDeepLearning.EClassifier with the given dataset for the specified number of iterations.
At the end of the training, the deep learning tool is in the state it was at the iteration that gave the minimum validation error. See eVision.EasyDeepLearning.EDeepLearningTool.BestIteration.
If no iterations is given, the training will stop automatically.
Remarks:
License(s): EasyClassify
| trainingDataset | eVision.EasyDeepLearning.EDataset with which to train the deep learning tool |
| validationDataset | eVision.EasyDeepLearning.EDataset with which to validate the deep learning tool |
| iterations | Number of iterations for training. |
|
static |
\endcond
Capacity of classifier to use. Be aware that changing the classifier capacity will delete the effect of any previous training. The capacity will be translated to the corresponding type (Small, Normal, or Large).
|
static |
\endcond
Number of channels for input images of the classifier. The number of channels can be either 1 (monochrome image) or 3 (RGB image). By default, this value will be set from the format of the first image added to the training dataset.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
static |
\endcond
Whether to always compute the heatmap along the result when applying the tool. If true, the heatmap is available through eVision.EasyDeepLearning.EClassificationResult.Heatmap.
|
static |
\endcond
Whether to compute the OOD parameters while training. Also determines whether the OOD score is computed alongside the result when applying the tool. If true, the OOD score is available through eVision.EasyDeepLearning.EClassificationResult.OODScore.
|
static |
\endcond
Enable automatic image reformat (true by default).
|
static |
\endcond
Enable histogram equalization of all images passing through the classifier. (false by default)
|
static |
\endcond
Height for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.
|
static |
\endcond
Minimum height for input images of the classifier. This value is equal to 1 for standard networks.
|
static |
\endcond
Minimum width for input images of the classifier. This value is equal to 1 for standard networks.
|
static |
\endcond
Model type for training. Default: "Normal".
The list of available models is available through eVision.EasyDeepLearning.EClassifier.GetAvailableModelTypes.
|
static |
\endcond
Out-Of-Distribution (OOD) threshold below which an image is considered to be OOD.
Remarks:
If training has been carried out with eVision.EasyDeepLearning.EClassifier.ComputeOODWithResult set to True, the parameters have been automatically initialized. Otherwise, call eVision.EasyDeepLearning.EClassifier.LearnOODParameters with the training data before calling this method.
The OOD threshold is automatically initialized during learning. If needed, the parameter can also be changed manually.
|
static |
\endcond
Type of the deep learning tool.
|
static |
\endcond
Whether to use a pre-trained model when training.
Default: true if the pre-trained model are found on the disk.
|
static |
\endcond
Width for input images of the classifier. By default, this value will be set to 224 if it wasn't explicitly set before training.
Remarks:
If the classifier is not trained or the value was not explicitly set, its value will be 0.