ObjectDetectionParameters Class Reference

Structure containing a set of parameters for the object detection module. More...

Functions

 ObjectDetectionParameters (bool enable_tracking_=true, bool enable_segmentation_=false, OBJECT_DETECTION_MODEL detection_model=OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_FAST, float max_range_=-1.f, BatchParameters batch_trajectories_parameters=BatchParameters(), OBJECT_FILTERING_MODE filtering_mode_=OBJECT_FILTERING_MODE::NMS3D, float prediction_timeout_s=0.2f, bool allow_reduced_precision_inference=false, unsigned int instance_id=0)
 Default constructor. More...
 
bool operator== (const ObjectDetectionParameters &param1) const
 
bool operator!= (const ObjectDetectionParameters &param1) const
 

Attributes

unsigned int instance_module_id = 0
 Id of the module instance. More...
 
bool enable_tracking = true
 Whether the object detection system includes object tracking capabilities across a sequence of images. More...
 
bool enable_segmentation = false
 Whether the object masks will be computed. More...
 
OBJECT_DETECTION_MODEL detection_model = OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_FAST
 sl::OBJECT_DETECTION_MODEL to use. More...
 
float max_range = -1.f
 Upper depth range for detections. More...
 
BatchParameters batch_parameters
 Batching system parameters. More...
 
OBJECT_FILTERING_MODE filtering_mode = OBJECT_FILTERING_MODE::NMS3D
 Filtering mode that should be applied to raw detections. More...
 
float prediction_timeout_s
 Prediction duration of the ZED SDK when an object is not detected anymore before switching its state to sl::OBJECT_TRACKING_STATE::SEARCHING. More...
 
bool allow_reduced_precision_inference
 Whether to allow inference to run at a lower precision to improve runtime and memory usage. More...
 

Detailed Description

Structure containing a set of parameters for the object detection module.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ ObjectDetectionParameters()

ObjectDetectionParameters ( bool  enable_tracking_ = true,
bool  enable_segmentation_ = false,
OBJECT_DETECTION_MODEL  detection_model = OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_FAST,
float  max_range_ = -1.f,
BatchParameters  batch_trajectories_parameters = BatchParameters(),
OBJECT_FILTERING_MODE  filtering_mode_ = OBJECT_FILTERING_MODE::NMS3D,
float  prediction_timeout_s = 0.2f,
bool  allow_reduced_precision_inference = false,
unsigned int  instance_id = 0 
)

Default constructor.

All the parameters are set to their default values.

Functions

◆ operator==()

bool operator== ( const ObjectDetectionParameters param1) const

Comparison operator ==

Parameters
ObjectDetectionParametersto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const ObjectDetectionParameters param1) const

Comparison operator !=

Parameters
ObjectDetectionParametersto compare
Returns
true if the two struct are different

Variables

◆ instance_module_id

unsigned int instance_module_id = 0

Id of the module instance.

This is used to identify which object detection module instance is used.

◆ enable_tracking

bool enable_tracking = true

Whether the object detection system includes object tracking capabilities across a sequence of images.

◆ enable_segmentation

bool enable_segmentation = false

Whether the object masks will be computed.

◆ detection_model

◆ max_range

float max_range = -1.f

Upper depth range for detections.

Default: -1.f (value set in sl::InitParameters.depth_maximum_distance)

Note
The value cannot be greater than sl::InitParameters.depth_maximum_distance and its unit is defined in sl::InitParameters.coordinate_units.

◆ batch_parameters

BatchParameters batch_parameters

Batching system parameters.

Batching system (introduced in 3.5) performs short-term re-identification with deep-learning and trajectories filtering.
sl::BatchParameters.enable must to be true to use this feature (by default disabled).

◆ filtering_mode

Filtering mode that should be applied to raw detections.

Default: sl::OBJECT_FILTERING_MODE::NMS_3D (same behavior as previous ZED SDK version)

Note
This parameter is only used in detection model sl::OBJECT_DETECTION_MODEL::MULTI_CLASS_BOX_XXX and sl::OBJECT_DETECTION_MODEL::CUSTOM_BOX_OBJECTS.
For custom object, it is recommended to use sl::OBJECT_FILTERING_MODE::NMS_3D_PER_CLASS or sl::OBJECT_FILTERING_MODE::NONE.
In this case, you might need to add your own NMS filter before ingesting the boxes into the object detection module.

◆ prediction_timeout_s

float prediction_timeout_s

Prediction duration of the ZED SDK when an object is not detected anymore before switching its state to sl::OBJECT_TRACKING_STATE::SEARCHING.

It prevents the jittering of the object state when there is a short misdetection.
The user can define their own prediction time duration.

Note
During this time, the object will have sl::OBJECT_TRACKING_STATE::OK state even if it is not detected.
The duration is expressed in seconds.
Warning
prediction_timeout_s will be clamped to 1 second as the prediction is getting worse with time.
Setting this parameter to 0 disables the ZED SDK predictions.

◆ allow_reduced_precision_inference

bool allow_reduced_precision_inference

Whether to allow inference to run at a lower precision to improve runtime and memory usage.

It might increase the initial optimization time and could include downloading calibration data or calibration cache and slightly reduce the accuracy.

Note
The fp16 is automatically enabled if the GPU is compatible and provides a speed up of almost x2 and reduce memory usage by almost half, no precision loss.
This setting allow int8 precision which can speed up by another x2 factor (compared to fp16, or x4 compared to fp32) and half the fp16 memory usage, however some accuracy could be lost.
The accuracy loss should not exceed 1-2% on the compatible models.
The current compatible models are all sl::AI_MODELS::HUMAN_BODY_XXXX.