apply_dl_modelT_apply_dl_modelApplyDlModelApplyDlModel (Operator)

Name

apply_dl_modelT_apply_dl_modelApplyDlModelApplyDlModel — Anwenden des Deep Learning-basierten Netzwerkes zur Inferenz auf einer Menge an Bildern.

Signatur

apply_dl_model( : : DLModelHandle, DLSampleBatch, Outputs : DLResultBatch)

Herror T_apply_dl_model(const Htuple DLModelHandle, const Htuple DLSampleBatch, const Htuple Outputs, Htuple* DLResultBatch)

void ApplyDlModel(const HTuple& DLModelHandle, const HTuple& DLSampleBatch, const HTuple& Outputs, HTuple* DLResultBatch)

HDictArray HDlModel::ApplyDlModel(const HDictArray& DLSampleBatch, const HTuple& Outputs) const

static void HOperatorSet.ApplyDlModel(HTuple DLModelHandle, HTuple DLSampleBatch, HTuple outputs, out HTuple DLResultBatch)

HDict[] HDlModel.ApplyDlModel(HDict[] DLSampleBatch, HTuple outputs)

Beschreibung

apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModel wendet das durch DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandle gegebene Deep Learning-basierte Netzwerk auf ein Batch von Eingabebildern an, die vom Dictionary DLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatch übergeben werden. Der Operator gibt die Ergebnisse im Ausgabe-Dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatch aus.

Für weitere Informationen zum Konzept und den Dictionaries des Deep Learning-Modells in HALCON siehe das Kapitel Deep Learning / Modell.

Um das Netzwerk auf Bilder anwenden zu können, müssen diese über ein Tupel von Dictionaries DLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatch übergeben werden. Dieses Tupel muss genau 'batch_size'"batch_size""batch_size""batch_size""batch_size" Dictionaries enthalten (der aktuelle Wert kann über get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam abgefragt werden). Dabei bezieht sich jedes Dictionary auf ein einzelnes Bild. Mit Hilfe der Prozedur gen_dl_samples_from_images kann solch ein Dictionary passend erstellt werden.

Es ist zu beachten, dass die Bilder eventuell vorverarbeitet werden müssen um die die Netzwerkanforderungen zu erfüllen, bevor sie dem Operator apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModel übergeben werden können. Mit get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam können die aktuellen Anforderungen des Netzwerks wie z.B. die Bilddimensionen abgefragt werden. Die Prozedur preprocess_dl_dataset gibt eine Anleitung für die Implementierung dieser Vorverarbeitung.

In OutputsOutputsOutputsOutputsoutputs kann spezifiziert werden, welche Daten vom Netzwerk in den Ergebnis-Dictionaries DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatch ausgegeben werden. Für weitere Informationen zum Ausgabe-Dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatch und dessen Schlüssel siehe das Kapitel Deep Learning / Modell. Dabei kann OutputsOutputsOutputsOutputsoutputs ein einzelner String, ein Tupel von Strings, oder ein leeres Tupel, mit dem alle möglichen Ausgaben abgerufen werden können, sein. Die Werte sind abhängig vom Modelltyp des verwendeten Netzwerks:

Modell mit 'type'"type""type""type""type"='detection'"detection""detection""detection""detection"
Modell mit 'type'"type""type""type""type"='segmentation'"segmentation""segmentation""segmentation""segmentation"

Achtung

Um diesen Operator ausführen zu können, werden cuDNN und cuBLAS benötigt, falls 'runtime'"runtime""runtime""runtime""runtime" auf 'gpu'"gpu""gpu""gpu""gpu" gesetzt ist (siehe get_dl_model_paramget_dl_model_paramGetDlModelParamGetDlModelParamGetDlModelParam). Für weitere Details wird auf den „Installation Guide“, Abschnitt „Requirements for Deep Learning“, verwiesen.

Ausführungsinformationen

Parameter

DLModelHandleDLModelHandleDLModelHandleDLModelHandleDLModelHandle (input_control)  dl_model HDlModel, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des Deep Learning-Modells.

DLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatchDLSampleBatch (input_control)  dict-array HDict, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Eingabedaten.

OutputsOutputsOutputsOutputsoutputs (input_control)  string-array HTupleHTupleHtuple (string) (string) (HString) (char*)

Angeforderte Ausgabedaten.

Defaultwert: []

Werteliste: [], 'segmentation_confidence'"segmentation_confidence""segmentation_confidence""segmentation_confidence""segmentation_confidence", 'segmentation_image'"segmentation_image""segmentation_image""segmentation_image""segmentation_image"

DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatch (output_control)  dict-array HDict, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle der Ergebnisdaten.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModel den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

read_dl_modelread_dl_modelReadDlModelReadDlModelReadDlModel, train_dl_model_batchtrain_dl_model_batchTrainDlModelBatchTrainDlModelBatchTrainDlModelBatch, set_dl_model_paramset_dl_model_paramSetDlModelParamSetDlModelParamSetDlModelParam

Modul

Deep Learning Inference