1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page lightsourcenet_usecase1 LightSourceNet Workflow
7 The LightSourceNet module creates handles of type `dwLightSourceNetHandle_t`, which is owned by the application and must be released by the application when not needed anymore.
9 An instance of type `dwLightSourceNetParams` encodes parameters (currently only network precision) that configure the LightSourceNet module. To initialize default LightSourceNet parameters:
12 dwStatus dwLightSourceNet_initDefaultParams(dwLightSourceNetParams* params);
15 To initialize a pointer to a `dwLightSourceNetHandle_t` instance with default parameter values:
18 dwStatus dwLightSourceNet_initialize(dwLightSourceNetHandle_t* lightSourceNetHandle,
19 const dwLightSourceNetParams* lightSourceNetParams,
20 dwContextHandle_t ctx);
23 An example code snippet to initialize required modules with default values:
26 // Initialize LightSourceNet
27 dwLightSourceNetHandle_t m_lightSourceNet = DW_NULL_HANDLE;
28 dwLightSourceNetParams m_lightSourceNetParams;
30 CHECK_DW_ERROR(dwLightSourceNet_initDefaultParams(&m_lightSourceNetParams));
31 CHECK_DW_ERROR(dwLightSourceNet_initialize(&m_lightSourceNet, &m_lightSourceNetParams, m_sdk));
34 where `m_sdk` is an initialized instance of `dwContextHandle_t`.
36 The initialized handle of LightSourceNet is used to initialize LightSourceDetector module.
38 ## Query Network Specs
40 With initialized handle to the LightSourceNet module, the following functions can be used to query size of expected input blob, size of output blob and network metadata respectively:
43 dwStatus dwLightSourceNet_getInputBlobSize(dwBlobSize* inputBlobsize, dwLightSourceNetHandle_t lightSourceNetHandle);
47 dwStatus dwLightSourceNet_getOutputBlobSize(dwBlobSize* outputBlobsize, dwLightSourceNetHandle_t lightSourceNetHandle);
51 dwStatus dwLightSourceNet_getDNNMetaData(dwDNNMetaData* metaData, dwLightSourceNetHandle_t lightSourceNetHandle);
54 ## Use for Inference and Post-processing
56 The LightSourceNet is closely coupled with LightSourceDetector. The neural network inference and post-processing is executed via LightSourceDetector APIs.
60 The following functions can be used to reset or release the initialized module handles:
63 dwStatus dwLightSourceNet_reset(dwLightSourceNetHandle_t lightSourceNetHandle);
67 dwStatus dwLightSourceNet_release(dwLightSourceNetHandle_t lightSourceNetHandle);
72 For usage of a sample application, please refer to @ref dwx_lightsourceperception_sample.