read_dl_model
— Read a deep learning model from a file.
read_dl_model( : : FileName : DLModelHandle)
The operator read_dl_model
reads a deep learning model
written by write_dl_model
.
As a result, the handle DLModelHandle
is returned.
The model is loaded from the file FileName
.
This file is hereby searched in the directory $HALCONROOT/dl/
as well as in the currently used directory.
Please note that the runtime specific parameter 'gpu' of the
model is not read from file. Instead it is initialized with its default
value (see get_dl_model_param
).
HALCON provides pretrained neural networks for classification and
semantic segmentation. These neural networks are good starting points to
train a custom network. They have been pretrained on a large image dataset.
Note, that classification networks can only be read by
read_dl_classifier
. Object detection uses pretrained classifiers as
base networks. Hence, the operator create_dl_model_detection
should
be used in combination with pretrained classifier networks for obejct
detection tasks.
The provided pretrained neural networks for semantic segmentation are:
This neural network is designed to handle segmentation tasks with detailed structures and uses only few memory and is runtime efficient.
The network architecture allows changes concerning the image dimensions, but requires a minimum 'image_width' and 'image_height' of 21 pixels.
This neural network has more hidden layers than 'pretrained_dl_segmentation_compact.hdl' and is therefore better suited for segmentation tasks including more complex scenes.
The network architecture allows changes concerning the image dimensions, but requires a minimum 'image_width' and 'image_height' of 81 pixels.
For further explanations to deep learning models in HALCON, see the chapter Deep Learning / Model.
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.
FileName
(input_control) filename.read →
(string)
Filename
Default value: 'pretrained_dl_segmentation_compact.hdl'
List of values: 'pretrained_dl_segmentation_compact.hdl' , 'pretrained_dl_segmentation_enhanced.hdl'
File extension: .hdl
DLModelHandle
(output_control) dl_model →
(handle)
Handle of the deep learning model.
If the parameters are valid, the operator read_dl_model
returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
set_dl_model_param
,
get_dl_model_param
,
apply_dl_model
,
train_dl_model_batch
Deep Learning Training