DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

perception/object/camera/lightsourcenet/docs/lightsourcenet_usecase1.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page lightsourcenet_usecase1 LightSourceNet Workflow
4 
5 ## Initialization
6 
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.
8 
9 An instance of type `dwLightSourceNetParams` encodes parameters (currently only network precision) that configure the LightSourceNet module. To initialize default LightSourceNet parameters:
10 
11 ```{.cpp}
12 dwStatus dwLightSourceNet_initDefaultParams(dwLightSourceNetParams* params);
13 ```
14 
15 To initialize a pointer to a `dwLightSourceNetHandle_t` instance with default parameter values:
16 
17 ```{.cpp}
18 dwStatus dwLightSourceNet_initialize(dwLightSourceNetHandle_t* lightSourceNetHandle,
19  const dwLightSourceNetParams* lightSourceNetParams,
20  dwContextHandle_t ctx);
21 ```
22 
23 An example code snippet to initialize required modules with default values:
24 
25 ```{.cpp}
26 // Initialize LightSourceNet
27 dwLightSourceNetHandle_t m_lightSourceNet = DW_NULL_HANDLE;
28 dwLightSourceNetParams m_lightSourceNetParams;
29 
30 CHECK_DW_ERROR(dwLightSourceNet_initDefaultParams(&m_lightSourceNetParams));
31 CHECK_DW_ERROR(dwLightSourceNet_initialize(&m_lightSourceNet, &m_lightSourceNetParams, m_sdk));
32 ```
33 
34 where `m_sdk` is an initialized instance of `dwContextHandle_t`.
35 
36 The initialized handle of LightSourceNet is used to initialize LightSourceDetector module.
37 
38 ## Query Network Specs
39 
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:
41 
42 ```{.cpp}
43 dwStatus dwLightSourceNet_getInputBlobSize(dwBlobSize* inputBlobsize, dwLightSourceNetHandle_t lightSourceNetHandle);
44 ```
45 
46 ```{.cpp}
47 dwStatus dwLightSourceNet_getOutputBlobSize(dwBlobSize* outputBlobsize, dwLightSourceNetHandle_t lightSourceNetHandle);
48 ```
49 
50 ```{.cpp}
51 dwStatus dwLightSourceNet_getDNNMetaData(dwDNNMetaData* metaData, dwLightSourceNetHandle_t lightSourceNetHandle);
52 ```
53 
54 ## Use for Inference and Post-processing
55 
56 The LightSourceNet is closely coupled with LightSourceDetector. The neural network inference and post-processing is executed via LightSourceDetector APIs.
57 
58 ## Reset and Release
59 
60 The following functions can be used to reset or release the initialized module handles:
61 
62 ```{.cpp}
63 dwStatus dwLightSourceNet_reset(dwLightSourceNetHandle_t lightSourceNetHandle);
64 ```
65 
66 ```{.cpp}
67 dwStatus dwLightSourceNet_release(dwLightSourceNetHandle_t lightSourceNetHandle);
68 ```
69 
70 ##Relevant Tutorials
71 
72 For usage of a sample application, please refer to @ref dwx_lightsourceperception_sample.