apply_dl_classifierT_apply_dl_classifierApplyDlClassifierApplyDlClassifier (Operator)

Name

apply_dl_classifierT_apply_dl_classifierApplyDlClassifierApplyDlClassifier — Infer the class affiliations for a set of images using a deep-learning-based classifier.

Signature

apply_dl_classifier(Images : : DLClassifierHandle : DLClassifierResultHandle)

Herror T_apply_dl_classifier(const Hobject Images, const Htuple DLClassifierHandle, Htuple* DLClassifierResultHandle)

void ApplyDlClassifier(const HObject& Images, const HTuple& DLClassifierHandle, HTuple* DLClassifierResultHandle)

HDlClassifierResult HDlClassifier::ApplyDlClassifier(const HImage& Images) const

void HDlClassifierResult::HDlClassifierResult(const HImage& Images, const HDlClassifier& DLClassifierHandle)

static void HOperatorSet.ApplyDlClassifier(HObject images, HTuple DLClassifierHandle, out HTuple DLClassifierResultHandle)

HDlClassifierResult HDlClassifier.ApplyDlClassifier(HImage images)

public HDlClassifierResult(HImage images, HDlClassifier DLClassifierHandle)

Description

apply_dl_classifierapply_dl_classifierApplyDlClassifierApplyDlClassifierApplyDlClassifier applies the deep-learning-based classifier given by DLClassifierHandleDLClassifierHandleDLClassifierHandleDLClassifierHandleDLClassifierHandle on the set of input images stored in the input object tuple ImagesImagesImagesImagesimages. It returns the results in the result handle DLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandle. For information how to retrieve the corresponding results stored in DLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandle, please refer to the documentation of the operator get_dl_classifier_resultget_dl_classifier_resultGetDlClassifierResultGetDlClassifierResultGetDlClassifierResult.

The tuple of images ImagesImagesImagesImagesimages can contain an arbitrary number of images. Please notice that this only holds for apply_dl_classifierapply_dl_classifierApplyDlClassifierApplyDlClassifierApplyDlClassifier and not for train_dl_classifier_batchtrain_dl_classifier_batchTrainDlClassifierBatchTrainDlClassifierBatchTrainDlClassifierBatch. This is because apply_dl_classifierapply_dl_classifierApplyDlClassifierApplyDlClassifierApplyDlClassifier always classifies a subbatch with up to 'batch_size_device'"batch_size_device""batch_size_device""batch_size_device""batch_size_device" images simultaneously, whether filled up or not. In case the number of images in the set ImagesImagesImagesImagesimages is larger than 'batch_size_device'"batch_size_device""batch_size_device""batch_size_device""batch_size_device", apply_dl_classifierapply_dl_classifierApplyDlClassifierApplyDlClassifierApplyDlClassifier iterates over the necessary number of subbatches. This also means that the runtime of processing for a given subbatch is independent of whether the subbatch is filled up or it just consists of a single image. On the other hand, if fewer images than 'batch_size_device'"batch_size_device""batch_size_device""batch_size_device""batch_size_device" are classified in one operator call, the network still requires the full amount of memory. Therefore, it is recommended to adapt the subbatch size accordingly. For further details corresponding to 'batch_size_device'"batch_size_device""batch_size_device""batch_size_device""batch_size_device", please refer to set_dl_classifier_paramset_dl_classifier_paramSetDlClassifierParamSetDlClassifierParamSetDlClassifierParam.

Note that the images must be processed before feeding them into the operator apply_dl_classifierapply_dl_classifierApplyDlClassifierApplyDlClassifierApplyDlClassifier in order to have the correct size, gray value range, number of channels and type. We would like to stress the image type: the images must be of type 'real'. For a possibly necessary conversion the operator convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageType is available. The procedure preprocess_dl_classifier_images provides great guidance on how to implement such a preprocessing stage.

For an explanation of the concept of deep-learning-based classification see the introduction of chapter Deep Learning / Classification.

Attention

To run this operator, cuDNN and cuBLAS are required when 'runtime'"runtime""runtime""runtime""runtime" is set to 'gpu'"gpu""gpu""gpu""gpu", see set_dl_classifier_paramset_dl_classifier_paramSetDlClassifierParamSetDlClassifierParamSetDlClassifierParam. For further details, please refer to the “Installation Guide”, paragraph “Requirements for Deep Learning”.

Execution Information

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

ImagesImagesImagesImagesimages (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (real)

Tuple of input images.

DLClassifierHandleDLClassifierHandleDLClassifierHandleDLClassifierHandleDLClassifierHandle (input_control)  dl_classifier HDlClassifier, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the deep-learning-based classifier.

DLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandleDLClassifierResultHandle (output_control)  dl_classifier_result HDlClassifierResult, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the deep learning classification results.

Result

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

Possible Predecessors

read_dl_classifierread_dl_classifierReadDlClassifierReadDlClassifierReadDlClassifier, train_dl_classifier_batchtrain_dl_classifier_batchTrainDlClassifierBatchTrainDlClassifierBatchTrainDlClassifierBatch, set_dl_classifier_paramset_dl_classifier_paramSetDlClassifierParamSetDlClassifierParamSetDlClassifierParam

Possible Successors

get_dl_classifier_resultget_dl_classifier_resultGetDlClassifierResultGetDlClassifierResultGetDlClassifierResult, clear_dl_classifierclear_dl_classifierClearDlClassifierClearDlClassifierClearDlClassifier

Alternatives

classify_class_mlpclassify_class_mlpClassifyClassMlpClassifyClassMlpClassifyClassMlp, classify_class_svmclassify_class_svmClassifyClassSvmClassifyClassSvmClassifyClassSvm

Module

Deep Learning Inference