DL_ClassifyObject


Header: AVLDL.h
Namespace: avl
Module: DeepLearning

Executes a Classify Object model on a single input image.

Syntax

void avl::DL_ClassifyObject
(
	const avl::Image& inImage,
	atl::Optional<const avl::Rectangle2D&> inRoi,
	atl::Optional<const avl::CoordinateSystem2D&> inRoiAlignment,
	const avl::ClassifyObjectModelId& inModelId,
	const bool inCreateRelevanceHeatmap,
	atl::Array<avl::ClassConfidence>& outConfidences,
	atl::String& outClassName,
	int& outClassIndex,
	float& outScore,
	avl::Heatmap& outRelevanceHeatmap
)

Parameters

Name Type Default Description
inImage const Image& Input image
inRoi Optional<const Rectangle2D&> NIL Limits the area where a classified object is located
inRoiAlignment Optional<const CoordinateSystem2D&> NIL
inModelId const ClassifyObjectModelId& Identifier of a Classify Object model
inCreateRelevanceHeatmap const bool False Enables creating a relevance heatmap at the expense of extended execution time
outConfidences Array<ClassConfidence>& Returns confidences for all classes
outClassName String& Returns the name of the class with the highest confidence
outClassIndex int& Returns the index of the class with the highest confidence
outScore float& Returns the value of the highest confidence
outRelevanceHeatmap Heatmap& Returns the heatmap indicating how strong specific parts of image influenced the classification result

Requirements

For input inImage only pixel formats are supported: 1⨯uint8, 3⨯uint8.

Read more about pixel formats in Image documentation.

Hints

  • It is recommended that the deep learning model is deployed with DL_ClassifyObject_Deploy first and connected through the inModelId input.
  • If one decides not to use DL_ClassifyObject_Deploy, then the model will be loaded in the first iteration. It will take up to several seconds.

Remarks

This filter should not be executed along with running Deep Learning Service as it may result in degraded performance or even out-of-memory errors. However, if stopping Deep Learning Service is not an option (e.g. program uses other Deep Learning filters related to Instances Segmentation) it is advised that this filter should be executed at least once before performing operations utilizing Deep Learning Service (e.g. executing filters related to Instances Segmentation). Such "warm up" execution does not have to use real image or roi as long as provided image and roi have similar size.

Errors

List of possible exceptions:

Error type Description
DomainError Not supported inImage pixel format in DL_ClassifyObject.

See Also

  • Models for Deep Learning may be created using Adaptive Vision Deep Learning Editor or using Training Api.