ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Image detection functions
  • Properties specific to aiNeuralNetworkModel variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
aiNeuralNetworkModel (Variable type)
In french: iaModèleRéseauDeNeurones
The aiNeuralNetworkModel type is used to define all the advanced characteristics of a neural network used by AIDetectModel. You can define and change the characteristics of this neural network using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Image declaration
MyImage is Image
MyImage = IMG_Test

// Declare a model
MyAINNModel is aiNeuralNetworkModel

MyAINNModel.Configuration = "MyModel.cfg"
MyAINNModel.TrainedWeights = "MyModel.weights.pb"
MyAINNModel.PixelScaleFactor = 1.0

// Caution: the X and Y dimensions depend on the model. 
// If the specified dimensions do not match the model,
// AIDetectModel returns an error. 
MyAINNModel.XDimension = 300 
MyAINNModel.YDimension = 300 

MyAINNModel.AverageIntensityR = 104
MyAINNModel.AverageIntensityG = 117
MyAINNModel.AverageIntensityB = 113
MyAINNModel.RGBColor = True

myMatrixArray is array of 1 array of 1 by 1 by 200 by 7 real

// Run model
myMatrixArray = AIDetectModel(MyAINNModel, MyImage)
Remarks

Properties specific to aiNeuralNetworkModel variables

The following properties can be used to handle a neural network model:
Property nameType usedEffect
AverageIntensityBIntegerAverage intensity of the Blue (B) color in the training data.
This property is optional.
AverageIntensityGIntegerAverage intensity of the Green (G) color in the training data.
This property is optional.
AverageIntensityRIntegerAverage intensity of the Red (R) color in the training data.
This property is optional.
ConfigurationCharacter stringFull path of the file that contains the configuration of the model.
Remark: The possible types of configurations are:
  • Caffe: *.prototxt
  • Tensorflow: *.pbtxt
  • Darknet: *.cfg
OutputLayerNameCharacter stringName of the output neural network layer.
PixelScaleFactorRealUsed to scale pixel values. Set to 1.0 by default (no scaling).
RGBColorBoolean
  • True if the provided images are encoded in RGB. In this case, the conversion to BGR encoding will be done automatically.
  • False (default value) if the provided images are encoded in BGR.
This property is optional.
TrainedWeightsCharacter string Full path of the file that contains the trained weights of the model.
Remark: The possible types of weights are:
  • Caffe: *.caffemodel
  • Tensorflow: *.pb
  • Darknet: *.weights
  • Open Neural Network Exchange (ONNX): *.onnx
TransposeRequiredBoolean
  • if transposition is required,
  • False otherwise.
When to use this property?
OpenCV creates matrices based on images and defines them as "Number of columns, Number of rows, Number of channels".
Some models expect matrices with the following format: "Number of channels, Number of columns, Number of rows". This means it is necessary to modify the matrix representation of the image created by OpenCV.
XDimensionIntegerImage size required by the model: X value.
By default, this property corresponds to the width of the image.
YDimensionIntegerImage size required by the model: Y value.
By default, this property corresponds to the height of the image.
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/31/2024

Send a report | Local help