Skip to content

create_dl_modelCreateDlModelCreateDlModelcreate_dl_modelT_create_dl_modelπŸ”—

Short descriptionπŸ”—

create_dl_modelCreateDlModelCreateDlModelcreate_dl_modelT_create_dl_model β€” Create a deep learning model.

SignatureπŸ”—

create_dl_model( dl_layer OutputLayers, out dl_model DLModelHandle )void CreateDlModel( const HTuple& OutputLayers, HTuple* DLModelHandle )static void HOperatorSet.CreateDlModel( HTuple outputLayers, out HTuple DLModelHandle )def create_dl_model( output_layers: MaybeSequence[HHandle] ) -> HHandle

Herror T_create_dl_model( const Htuple OutputLayers, Htuple* DLModelHandle )

void HDlModel::HDlModel( const HDlLayerArray& OutputLayers )

void HDlModel::HDlModel( const HDlLayer& OutputLayers )

public HDlModel( HDlLayer[] outputLayers )

public HDlModel( HDlLayer outputLayers )

void HDlModel::CreateDlModel( const HDlLayerArray& OutputLayers )

void HDlModel::CreateDlModel( const HDlLayer& OutputLayers )

void HDlModel.CreateDlModel( HDlLayer[] outputLayers )

void HDlModel.CreateDlModel( HDlLayer outputLayers )

DescriptionπŸ”—

The operator create_dl_modelCreateDlModel creates a deep learning model from a graph and returns its handle in DLModelHandleDLModelHandledlmodel_handle.

A deep learning model in HALCON mainly consists of a directed acyclic graph that defines the networks architecture. Further components of a deep learning model in HALCON are parameters as 'class_names'"class_names", 'class_ids'"class_ids", and many others, or hyperparameters that are needed to train a model, as for example the 'learning_rate'"learning_rate". While parameters and hyperparameters can be set after creation of the model using set_dl_model_paramSetDlModelParam, the model itself can only be created using create_dl_modelCreateDlModel if its network architecture is given in form of a graph.

To build a graph that defines the models network architecture, one needs to put together the networks layers. In general, a graph starts with an input layer. A subsequent layer that follows after the input layer uses the input layer as feeding layer, and the new layer itself might be used as a feeding layer for the next layer, and so on. This is repeated until the graphs output layers (e.g., softmax or loss layers) are appended to the graph. To create a layer, use its specified creation operator, e.g., an input layer is created using create_dl_layer_inputCreateDlLayerInput, a convolution layer is created using create_dl_layer_convolutionCreateDlLayerConvolution, and so on.

When the graph is defined, a model can be created using create_dl_modelCreateDlModel by passing over the graphs output layer handles in OutputLayersoutputLayersoutput_layers. Note that the output layer handles save all other layers that directly or indirectly serve as feeding input layers for the output layers during their creation. This means that the output layer handles keep the whole network architecture necessary for the creation of the model using create_dl_modelCreateDlModel.

The type of the created model, hence the task the model is designed for (classification, object detection, segmentation), is only given by the networks architecture. However, if the networks architecture allows it, the type of the model, 'type'"type", can be set using set_dl_model_paramSetDlModelParam. A specified model type allows a more user friendly usage in the HALCON deep learning workflow. Supported types are:

Furthermore, many deep learning procedures provide more functionality for the model if its type is set. As an example, dev_display_dl_data can be used to display the inferred results more nicely.

Note that setting a model type requires that the graph fulfills certain structure conditions. We recommend to follow the architecture of our delivered neuronal networks if the model type should be set to one of these types.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

ParametersπŸ”—

OutputLayersoutputLayersoutput_layers (input_control) dl_layer(-array) β†’ (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)MaybeSequence[HHandle]Htuple (handle)

Output layers of the graph.

DLModelHandleDLModelHandledlmodel_handle (output_control) dl_model β†’ (handle)HTuple (HHandle)HDlModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the deep learning model.

ResultπŸ”—

If the parameters are valid, the operator create_dl_modelCreateDlModel returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

create_dl_layer_softmaxCreateDlLayerSoftmax, create_dl_layer_loss_cross_entropyCreateDlLayerLossCrossEntropy, create_dl_layer_loss_focalCreateDlLayerLossFocal, create_dl_layer_loss_huberCreateDlLayerLossHuber

Possible successors

set_dl_model_paramSetDlModelParam

ModuleπŸ”—

Deep Learning Professional