IDS peak comfortC v1.9.0
Loading...
Searching...
No Matches
Inference types and values

Data Structures

struct  peak_inference_result_detection
 The inference detection result. More...
 
struct  peak_inference_result_classification
 The inference classification result. More...
 
struct  peak_inference_result_data
 The peak inference result. More...
 
struct  peak_inference_info
 The peak information struct for CNN details. More...
 

Typedefs

typedef struct peak_inference * peak_inference_handle
 The handle to identify an inference instance.
 
typedef struct peak_inference_result * peak_inference_result_handle
 The handle to identify an inference result.
 

Enumerations

enum  peak_inference_type { PEAK_INFERENCE_TYPE_INVALID , PEAK_INFERENCE_TYPE_DETECTION , PEAK_INFERENCE_TYPE_CLASSIFICATION }
 peak inference types More...
 
enum  peak_inference_preprocessing_mode { PEAK_INFERENCE_PREPROCESSING_MODE_INVALID , PEAK_INFERENCE_PREPROCESSING_MODE_CAFFE , PEAK_INFERENCE_PREPROCESSING_MODE_TENSORFLOW }
 peak inference preprocessing modes. More...
 

Functions

peak_status peak_Inference_CNN_Open (const char *path, peak_inference_handle *hInference)
 Loads a cnn file from the file system and returns a handle to the inference instance.
 
peak_status peak_Inference_CNN_Close (peak_inference_handle hInference)
 Unloads a cnn instance.
 
peak_status peak_Inference_CNN_ProcessFrame (peak_inference_handle hInference, peak_frame_handle hFrame, peak_inference_result_handle *hInferenceHandle)
 Runs an image through a cnn and returns the inference result. This call is blocking and returns once the inference is finished processing.
 
peak_status peak_Inference_CNN_Info_Get (peak_inference_handle hInference, peak_inference_info *info)
 Gets detailed info about the loaded CNN.
 
peak_status peak_Inference_Result_Get (peak_inference_result_handle hInferenceHandle, peak_inference_result_data *result)
 Get the result from a previous inference call.
 
peak_status peak_Inference_Result_Release (peak_inference_result_handle hInferenceHandle)
 Releases a inference result that was previously received from peak_Inference_CNN_ProcessFrame.
 
peak_status peak_Inference_Result_Classification_GetList (peak_inference_result_handle hInferenceHandle, peak_inference_result_classification *resultList, size_t *resultCount)
 Get the result entries from a given classification inference result handle.
 
peak_status peak_Inference_Result_Detection_GetList (peak_inference_result_handle hInferenceHandle, peak_inference_result_detection *resultList, size_t *resultCount)
 Get the result entries from a given detection inference result handle.
 
peak_status peak_Inference_Statistics_Get (peak_inference_handle hInference, peak_inference_statistics *statistics)
 Gets the inference statistics.
 
peak_status peak_Inference_Statistics_Reset (peak_inference_handle hInference)
 Resets the inference statistics.
 
peak_status peak_Inference_ConfidenceThreshold_Get (peak_inference_handle hInference, uint32_t *threshold)
 Gets the confidence threshold of the inference.
 
peak_status peak_Inference_ConfidenceThreshold_GetRange (peak_inference_handle hInference, uint32_t *minThreshold, uint32_t *maxThreshold, uint32_t *incThreshold)
 Gets the allowed range for setting the confidence threshold.
 
peak_status peak_Inference_ConfidenceThreshold_Set (peak_inference_handle hInference, uint32_t threshold)
 Sets the confidence threshold for the inference. Lower thresholds include more results.
 

Detailed Description

Definitions on inference types and values.

Enumeration Type Documentation

◆ peak_inference_preprocessing_mode

peak inference preprocessing modes.

Enumerator
PEAK_INFERENCE_PREPROCESSING_MODE_INVALID 

Invalid inference preprocessing mode.

Use this value for the initialization of variables of type peak_inference_preprocessing_mode.

PEAK_INFERENCE_PREPROCESSING_MODE_CAFFE 

Caffe preprocessing mode.

PEAK_INFERENCE_PREPROCESSING_MODE_TENSORFLOW 

Tensorflow preprocessing mode.

◆ peak_inference_type

peak inference types

The inference type specifies the CNN model.

Enumerator
PEAK_INFERENCE_TYPE_INVALID 

Invalid inference type.

Use this value for the initialization of variables of type peak_inference_type.

PEAK_INFERENCE_TYPE_DETECTION 

CNN detection model.

PEAK_INFERENCE_TYPE_CLASSIFICATION 

CNN classification model.

Function Documentation

◆ peak_Inference_CNN_Close()

peak_status peak_Inference_CNN_Close ( peak_inference_handle  hInference)

Unloads a cnn instance.

Parameters
[in]hInferenceHandle to an inference instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_CNN_Info_Get()

peak_status peak_Inference_CNN_Info_Get ( peak_inference_handle  hInference,
peak_inference_info *  info 
)

Gets detailed info about the loaded CNN.

Parameters
[in]hInferenceHandle to an inference instance.
[out]infoDetailed info about the CNN.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER info is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_CNN_Open()

peak_status peak_Inference_CNN_Open ( const char *  path,
peak_inference_handle *  hInference 
)

Loads a cnn file from the file system and returns a handle to the inference instance.

Parameters
[in]pathPath to the cnn file UTF-8 encoded.
[out]hInferenceHandle to the newly created inference instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER path or hInference is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_OUT_OF_MEMORY The library is out of memory.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_CNN_ProcessFrame()

peak_status peak_Inference_CNN_ProcessFrame ( peak_inference_handle  hInference,
peak_frame_handle  hFrame,
peak_inference_result_handle *  hInferenceHandle 
)

Runs an image through a cnn and returns the inference result. This call is blocking and returns once the inference is finished processing.

Parameters
[in]hInferenceHandle to an inference instance.
[in]hFrameHandle to a frame.
[out]hInferenceHandleHandle to an inference result.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER resultHandle is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hInference or hFrame is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_OUT_OF_MEMORY The library is out of memory.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_ConfidenceThreshold_Get()

peak_status peak_Inference_ConfidenceThreshold_Get ( peak_inference_handle  hInference,
uint32_t *  threshold 
)

Gets the confidence threshold of the inference.

Parameters
[in]hInferenceHandle to an inference instance.
[out]thresholdConfidence threshold of the inference.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER threshold is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_ConfidenceThreshold_GetRange()

peak_status peak_Inference_ConfidenceThreshold_GetRange ( peak_inference_handle  hInference,
uint32_t *  minThreshold,
uint32_t *  maxThreshold,
uint32_t *  incThreshold 
)

Gets the allowed range for setting the confidence threshold.

Parameters
[in]hInferenceHandle to an inference instance.
[out]minThresholdMinimum value of allowed confidence threshold.
[out]maxThresholdMaximum value of allowed confidence threshold.
[out]incThresholdIncrement of the confidence threshold.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER minThreshold, or maxThreshold, or incThreshold is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_ConfidenceThreshold_Set()

peak_status peak_Inference_ConfidenceThreshold_Set ( peak_inference_handle  hInference,
uint32_t  threshold 
)

Sets the confidence threshold for the inference. Lower thresholds include more results.

Parameters
[in]hInferenceHandle to an inference instance.
[in]thresholdConfidence threshold to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_Result_Classification_GetList()

peak_status peak_Inference_Result_Classification_GetList ( peak_inference_result_handle  hInferenceHandle,
peak_inference_result_classification *  resultList,
size_t *  resultCount 
)

Get the result entries from a given classification inference result handle.

Provides the current list of result entries for classification

This function implements the Two Staged Data Query principle.

Parameters
[in]hInferenceHandleHandle to an inference result.
[out]resultListPointer to a user allocated array buffer to receive the result entry list. If this parameter is NULL, resultCount will contain the current number of result entries.
The required size for resultList in bytes is resultCount x sizeof(peak_inference_result_classification)
[in,out]resultCount
  • resultList equal NULL:
    out: minimal number of result entries resultList must be large enough to hold
  • resultList unequal NULL:
    in: number of result entries resultList can hold
    out: number of result entries filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER resultCount is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE resultHandle is an invalid handle.
PEAK_STATUS_BUFFER_TOO_SMALL resultList is not NULL and the value of *resultCount is too small to receive the expected amount of data.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_Result_Detection_GetList()

peak_status peak_Inference_Result_Detection_GetList ( peak_inference_result_handle  hInferenceHandle,
peak_inference_result_detection *  resultList,
size_t *  resultCount 
)

Get the result entries from a given detection inference result handle.

Provides the current list of result entries for detection

This function implements the Two Staged Data Query principle.

Parameters
[in]hInferenceHandleHandle to an inference result.
[out]resultListPointer to a user allocated array buffer to receive the result entry list. If this parameter is NULL, resultCount will contain the current number of result entries.
The required size for resultList in bytes is resultCount x sizeof(peak_inference_result_detection)
[in,out]resultCount
  • resultList equal NULL:
    out: minimal number of result entries resultList must be large enough to hold
  • resultList unequal NULL:
    in: number of result entries resultList can hold
    out: number of result entries filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER resultCount is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE resultHandle is an invalid handle.
PEAK_STATUS_BUFFER_TOO_SMALL resultList is not NULL and the value of *resultCount is too small to receive the expected amount of data.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_Result_Get()

peak_status peak_Inference_Result_Get ( peak_inference_result_handle  hInferenceHandle,
peak_inference_result_data *  result 
)

Get the result from a previous inference call.

Parameters
[in]hInferenceHandleHandle to an inference result.
[out]resultInference result.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER result is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE resultHandle is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_Result_Release()

peak_status peak_Inference_Result_Release ( peak_inference_result_handle  hInferenceHandle)

Releases a inference result that was previously received from peak_Inference_CNN_ProcessFrame.

Parameters
[in]hInferenceHandleHandle to an inference result.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE resultHandle is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
The result handle is no longer valid after the function has returned.

◆ peak_Inference_Statistics_Get()

peak_status peak_Inference_Statistics_Get ( peak_inference_handle  hInference,
peak_inference_statistics *  statistics 
)

Gets the inference statistics.

Parameters
[in]hInferenceHandle to an inference instance.
[out]statisticsInference statistics for the given hInference.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER statistics is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Inference_Statistics_Reset()

peak_status peak_Inference_Statistics_Reset ( peak_inference_handle  hInference)

Resets the inference statistics.

Parameters
[in]hInferenceHandle to an inference instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hInference is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.