The ClearSightNet and ClearSightNetDetector modules create handles of types dwClearSightNetHandle_t
and dwBlindnessDetectorHandle_t
respectively. Both of these handles are owned by the application and must be released by the application when not needed anymore.
An instance of type dwClearSightNetParams
encodes parameters that configure the ClearSightNet module. To initialize default ClearSightNet parameters:
To initialize a pointer to a dwClearSightNetHandle_t
instance with default parameter values:
An instance of type dwBlindnessDetectorParams
encapsulates several configuration parameters and encapsulates a handle to ClearSightNet (of type dwClearSightNetHandle_t
) that configure the BlindnessDetector module.
To initialize in instance of dwBlindnessDetectorParams
with default values:
This initializes the members dwBlindnessDetectorParams.temporalFilterWindow
, dwBlindnessDetectorParams.numRegionsX
and dwBlindnessDetectorParams.numRegionsY
to 5, 1 and 1 respectively.
To initialize a pointer to a dwBlindnessDetectorHandle_t
instance with an initialized ClearSightNet handle and default parameter values:
An example code snippet to initialize required modules with default values to perfrom inference on GPU:
where m_sdk
is an initialized instance of dwContextHandle_t
.
Another code snippet to initialize required modules with parameters that enable 3 sub-regions in each direction:
Note that values for parameters dwBlindnessDetectorParams.regionDividersX
and dwBlindnessDetectorParams.regionDividersY
are specified in image fractions. This will create sub-region dividers at 20% and 80% of image width and height.
With initialized handle to the ClearSightNet module, the following functions can be used to query size of expected input blob, size of output blob and network metadata respectively:
With initialized handle to the ClearSightNetDetector module, the following functions can be used to perform inference on an image and retrieve the processed output:
The dwBlindnessDetector_detect()
function performs inference asynchronously. This means that an inference call can be queued using dwBlindnessDetector_detect()
and then other computation can be performed and dwBlindnessDetector_getOutput()
, whenever called, will automatically wait for the inference to finish before returning the output. To this end, the following functions can be used to set and get CUDA the stream used by the module:
The following functions can be used to reset or release the initialized module handles whenever necessary:
For usage of a sample application, please refer to Camera Blindness Detection Sample (ClearSightNet).