BatchParameters Class Reference

Structure containing a set of parameters for batch object detection. More...

Functions

 BatchParameters (bool enable=false, float id_retention_time=240.f, float batch_duration=2.f)
 Default constructor. More...
 
bool save (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const BatchParameters &param1) const
 
bool operator!= (const BatchParameters &param1) const
 

Attributes

bool enable = false
 Whether to enable the batch option in the object detection module. More...
 
float id_retention_time = 240
 Max retention time in seconds of a detected object. More...
 
float latency = 2.f
 Trajectories will be output in batch with the desired latency in seconds. More...
 

Detailed Description

Structure containing a set of parameters for batch object detection.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ BatchParameters()

BatchParameters ( bool  enable = false,
float  id_retention_time = 240.f,
float  batch_duration = 2.f 
)

Default constructor.

All the parameters are set to their default values.

Functions

◆ save()

bool save ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Saves the current set of parameters into a file to be reloaded with the load() method.

Parameters
filename: Name of the file which will be created to store the parameters (extension '.yml' will be added if not set).
Returns
True if the file was successfully saved, otherwise false.
Warning
For security reasons, the file must not already exist.
In case a file already exists, the method will return false and existing file will not be updated.

◆ load()

bool load ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Loads a set of parameters from the values contained in a previously saved file.

Parameters
filename: Path to the file from which the parameters will be loaded (extension '.yml' will be added at the end of the filename if not detected).
Returns
True if the file was successfully loaded, otherwise false.

◆ encode()

bool encode ( String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if the decoding was successful, otherwise false.

◆ operator==()

bool operator== ( const BatchParameters param1) const

Comparison operator ==

Parameters
BatchParametersto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const BatchParameters param1) const

Comparison operator !=

Parameters
BatchParametersto compare
Returns
true if the two struct are different

Variables

◆ enable

bool enable = false

Whether to enable the batch option in the object detection module.

Batch queueing system provides:

  • deep-learning based re-identification
  • trajectory smoothing and filtering
Note
To activate this option, enable must be set to true.

◆ id_retention_time

float id_retention_time = 240

Max retention time in seconds of a detected object.

After this time, the same object will mostly have a different id.

◆ latency

float latency = 2.f

Trajectories will be output in batch with the desired latency in seconds.

During this waiting time, re-identification of objects is done in the background.

Note
Specifying a short latency will limit the search (falling in timeout) for previously seen object ids but will be closer to real time output.
Specifying a long latency will reduce the change of timeout in re-identification but increase difference with live output.