DeepSight SDK  1.0.2
DeepSight SDK - crowd face analysis
ds::Settings Class Reference

DeepSight SDK settings class. More...

Public Types

enum  OperationMode : int { OperationMode::DEVELOPMENT, OperationMode::RELEASE_LIFETIME, OperationMode::RELEASE_SESSION }
 The mode the SDK should operate when authenticating. More...
 
enum  LogLevel : int {
  LogLevel::TRACE, LogLevel::DEBUG, LogLevel::INFO, LogLevel::WARN,
  LogLevel::ERR, LogLevel::CRITICAL
}
 The log-level that should internally be used by the SDK. More...
 
enum  DnnTarget : int { DnnTarget::CPU, DnnTarget::GPU, DnnTarget::GPU_MT }
 Target processor on which the SDK's neural networks should execute. More...
 
enum  BodyTrackFps : int { BodyTrackFps::DYNAMIC, BodyTrackFps::FPS_30, BodyTrackFps::FPS_10, BodyTrackFps::FPS_5 }
 Frame processing speed for which the people counting algorithm should be tuned. More...
 

Public Member Functions

void load (const std::string &filePath)
 Loads an ini settings file into the ds::Settings instance. More...
 
void save (const std::string &filePath)
 Saves the object's parameters into a DeepSight settings ini file. More...
 
bool operator!= (const Settings &settings) const
 Returns true if the this object is not equal to settings. Inequality is tested member-wise.
 
bool operator== (const Settings &settings) const
 Returns true if the this object is equal to settings. Equality is tested member-wise.
 
bool cpuTargetEnabled () const
 Returns true if the dnnTarget value for this settings object is set to 'CPU'.
 
bool gpuTargetEnabled () const
 Returns true if the dnnTarget value for this settings object is set to 'GPU' or 'GPU_MT'.
 

Public Attributes

std::string neuralNetworksPath = ""
 Path of the directory containing the SDK neural network files. More...
 
std::string licenseKey = ""
 License key used for authenticating the SDK.
 
std::string lifetimeAuthFile = ""
 File path where the authorization for the lifetime release license is saved. More...
 
OperationMode operationMode = OperationMode::DEVELOPMENT
 Operation mode the SDK should authenticate with.
 
LogLevel logLevel = LogLevel::INFO
 Log-level the SDK should operate with. Accepted enum values are 'INFO', 'WARN', 'ERR', and 'CRITICAL'. 'TRACE' and 'DEBUG' are reserved for internal use.
 
DnnTarget dnnTarget = DnnTarget::GPU
 Target processor on which the SDK's neural networks should execute. Accepted enum values are 'CPU', 'GPU', and 'GPU_MT'. More...
 
BodyTrackFps bodyTrackFps = BodyTrackFps::DYNAMIC
 Tunes the people counting algorithm to the video input fps. Use ds::Settings::DYNAMIC for live feed input cameras and use ds::Settings::FPS_30 for video files (most commonly encoded at 30 fps).
 
bool useAge = true
 Tells the SDK whether it should perform age estimation for each detected face.
 
bool useGender = true
 Tells the SDK whether it should perform gender estimation for each detected face.
 
bool useHeadpose = true
 Tells the SDK whether it should perform head pose estimation for each detected face.
 
bool useSmile = true
 Tells the SDK whether it should perform smile estimation for each detected face.
 
bool useFaceMask = true
 Tells the SDK whether it should perform face mask estimation for each detected face.
 
bool usePeopleCount = false
 Tells the SDK whether it should detect, track and count bodies. The people count is returned by ds::DeepSight::getPeopleCount().
 
float faceConfidenceThreshold = 0.8f
 Face confidence threshold. More...
 
int maxNumFaces = -1
 Controls the maximum number of faces that will be returned per frame after detection. A value of -1 (default) indicates no limit.
 
int minFaceSize = 0
 Unless set to 0, faces smaller than this value will be discarded after detection.
 
int maxFaceSize = 0
 Unless set to 0, faces bigger than this value will be discarded after detection.
 
int numThreads = -1
 Controls the number of threads used to execute parallel computation regions, like inference. More...
 

Detailed Description

DeepSight SDK settings class.

The ds::Settings class is a container for configuration parameters used during runtime. By changing the settings values it is possible to control the SDK behavior.

Member Enumeration Documentation

◆ BodyTrackFps

enum ds::Settings::BodyTrackFps : int
strong

Frame processing speed for which the people counting algorithm should be tuned.

Enumerator
DYNAMIC 

Dynamically tunes the body tracker to the current fps speed. To be used with real-time input like webcams of IP cameras.

FPS_30 

Tunes the body tracker to an input speed of 30 fps. To be used only with video files encoded at about 30 fps (most common encoding).

FPS_10 

Tunes the body tracker to an input speed of 10 fps. To be used only with video files encoded at about 10 fps (almost never used).

FPS_5 

Tunes the body tracker to an input speed of 5 fps. To be used only with video files encoded at about 5 fps (almost never used).

◆ DnnTarget

enum ds::Settings::DnnTarget : int
strong

Target processor on which the SDK's neural networks should execute.

Enumerator
CPU 

Uses the CPU for performing inference on the networks.

GPU 

Uses the GPU for accelerating the inference on the networks. Refer to the OpenCL acceleration OpenCL section.

GPU_MT 

Uses the GPU for accelerating the inference performed on the SDK's networks. Inference of the different networks will be performed in parallel. Refer to the OpenCL acceleration OpenCL section.

◆ LogLevel

enum ds::Settings::LogLevel : int
strong

The log-level that should internally be used by the SDK.

Enumerator
TRACE 

Trace logging level (reserved for internal use).

DEBUG 

Debug logging level (reserved for internal use).

INFO 

Info logging level.

WARN 

Warning logging level.

ERR 

Error logging level.

CRITICAL 

Critical logging level.

◆ OperationMode

enum ds::Settings::OperationMode : int
strong

The mode the SDK should operate when authenticating.

The SDK license can operate in different modalities. This enumerations holds the modalities the SDK can use the license with.

Enumerator
DEVELOPMENT 

Uses the license in development mode.

RELEASE_LIFETIME 

Uses the license in lifetime release mode.

RELEASE_SESSION 

Uses the license in session release mode.

Member Function Documentation

◆ load()

void ds::Settings::load ( const std::string &  filePath)

Loads an ini settings file into the ds::Settings instance.

Parameters
filePathPath of a file storing DeepSight settings.

Throws an std::runtime_error if the file cannot be loaded.

Example usage:

try
{
s.load( "/path/to/settings" )
}
catch( const std::runtime_error & e )
{
std::cerr << "Could not load settings : " << e.what() << std::endl;
}

◆ save()

void ds::Settings::save ( const std::string &  filePath)

Saves the object's parameters into a DeepSight settings ini file.

Parameters
filePathPath of a file where to store DeepSight settings.

Throws an std::runtime_error if the file cannot be saved.

Example usage:

try
{
s.save( "/path/to/settings" )
}
catch( const std::runtime_error & e )
{
std::cerr << "Could not save settings : " << e.what() << std::endl;
}

Member Data Documentation

◆ dnnTarget

ds::Settings::DnnTarget ds::Settings::dnnTarget = DnnTarget::GPU

Target processor on which the SDK's neural networks should execute. Accepted enum values are 'CPU', 'GPU', and 'GPU_MT'.

To enable GPU acceleration refer to OpenCL acceleration.

Note
The GPU_MT option is currently experimental and enables concurrent GPU network inference. This may cause a gradual loss of performance over time.

◆ faceConfidenceThreshold

float ds::Settings::faceConfidenceThreshold = 0.8f

Face confidence threshold.

This threshold controls the confidence level the SDK returns faces with. Faces detected during ds::DeepSight::analyze and ds::DeepSight::analyzeSingleImage with a confidence lower than the specified faceConfidenceThreshold will be discarded. Valid values are in the range [0, 1].

◆ lifetimeAuthFile

std::string ds::Settings::lifetimeAuthFile = ""

File path where the authorization for the lifetime release license is saved.

Use in combination with ds::Settings::operationMode set to ds::Settings::OperationMode::RELEASE_LIFETIME.

Example:

s.lifetimeAuthFile = "/path/to/lifetime_authorization";
ds::DeepSight ds{ settings };
ds.authenticate();

◆ neuralNetworksPath

std::string ds::Settings::neuralNetworksPath = ""

Path of the directory containing the SDK neural network files.

Failing to properly set this parameter causes the ds::DeepSight constructor to fail and throw an exception.

◆ numThreads

int ds::Settings::numThreads = -1

Controls the number of threads used to execute parallel computation regions, like inference.

This parameter controls how much CPU is used on multicore systems. Set to -1 to use the system default. Setting this parameter to a value lower that the number of CPU cores will leave the remaining CPU cores available for other computation. Eg. On a 4-core setup, setting ds::Settings::numThreads to 2 will leave ~50% of CPU available for other processes.

Note
This parameter is set internally using cv::setNumThreads() at the beginning of each ds::DeepSight::analyze or ds::DeepSight::analyzeSingleImage call. If cv::setNumThreads() is used externally, the number of threads will be set to ds::Settings::numThreads at the next call of ds::DeepSight::analyze or ds::DeepSight::analyzeSingleImage.