CustomObjectDetectionRuntimeParameters Class Reference

Structure containing a set of runtime parameters for the object detection module using your own model ran by the SDK. More...

Functions

 CustomObjectDetectionRuntimeParameters (const CustomObjectDetectionProperties &object_detection_properties=CustomObjectDetectionProperties{}, const std::unordered_map< int, CustomObjectDetectionProperties > &object_class_detection_properties=std::unordered_map< int, CustomObjectDetectionProperties >{})
 Default constructor. More...
 
bool save (const 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 (const 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 CustomObjectDetectionRuntimeParameters &params) const
 
bool operator!= (const CustomObjectDetectionRuntimeParameters &params) const
 

Attributes

CustomObjectDetectionProperties object_detection_properties
 Global object detection properties. More...
 
std::unordered_map< int, CustomObjectDetectionPropertiesobject_class_detection_properties
 Per class object detection properties. More...
 

Detailed Description

Structure containing a set of runtime parameters for the object detection module using your own model ran by the SDK.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ CustomObjectDetectionRuntimeParameters()

CustomObjectDetectionRuntimeParameters ( const CustomObjectDetectionProperties object_detection_properties = CustomObjectDetectionProperties{},
const std::unordered_map< int, CustomObjectDetectionProperties > &  object_class_detection_properties = std::unordered_map< int, CustomObjectDetectionProperties >{} 
)

Default constructor.

Parameters
object_detection_propertiesGlobal object properties, when not specified in object_class_detection_properties.
object_class_detection_propertiesObject properties per classes.

Functions

◆ save()

bool save ( const 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 ( const 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 CustomObjectDetectionRuntimeParameters params) const

Comparison operator ==

Parameters
paramsCustomObjectDetectionRuntimeParameters to compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const CustomObjectDetectionRuntimeParameters params) const

Comparison operator !=

Parameters
paramsCustomObjectDetectionRuntimeParameters to compare
Returns
true if the two struct are different

Variables

◆ object_detection_properties

CustomObjectDetectionProperties object_detection_properties

Global object detection properties.

Note
object_detection_properties is used as a fallback when sl::CustomObjectDetectionRuntimeParameters.object_class_detection_properties is partially set.

◆ object_class_detection_properties

std::unordered_map<int , CustomObjectDetectionProperties> object_class_detection_properties

Per class object detection properties.