DriveWorks SDK Reference

| 0.6.67 Release

Detector.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2016 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
46 #ifndef DW_OBJECT_DETECTOR_H__
47 #define DW_OBJECT_DETECTOR_H__
48 
49 #include <dw/object/Object.h>
50 #include <dw/object/DriveNet.h>
51 #include <dw/dnn/DNN.h>
53 #include <dw/image/Image.h>
54 #include <dw/core/Context.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
61 #define DW_OBJECT_DETECTOR_MAX_IMAGES 16
62 
64 
67 typedef struct dwObjectDetectorObject *dwObjectDetectorHandle_t;
68 
69 typedef struct {
85  const char *coverageBlobName;
87  const char *boundingBoxBlobName;
89  const char *bottomVisBlobName;
91  const char *horizontalVisBlobName;
97  float32_t coverageThreshold[DW_OBJECT_MAX_CLASSES];
101 
102 typedef struct {
104  uint32_t maxNumImages;
105 
110 
113  dwTransformation2D transformations[DW_OBJECT_DETECTOR_MAX_IMAGES];
114 
119 
124 
126 // dwObjectDetector
127 
138  dwObjectDetectorParams *detectorParams);
139 
140 
171 dwStatus dwObjectDetector_initialize(dwObjectDetectorHandle_t *obj, dwContextHandle_t ctx,
172  dwDNNHandle_t dnn,
173  const dwObjectDetectorDNNParams *dnnParams,
174  const dwObjectDetectorParams *detectorParams);
175 
187 dwStatus dwObjectDetector_initializeFromDriveNet(dwObjectDetectorHandle_t *obj, dwContextHandle_t ctx,
188  dwDriveNetHandle_t drivenet,
189  const dwObjectDetectorParams *detectorParams);
190 
199 dwStatus dwObjectDetector_reset(dwObjectDetectorHandle_t obj);
200 
211 dwStatus dwObjectDetector_release(dwObjectDetectorHandle_t *obj);
212 
228 dwStatus dwObjectDetector_setROI(uint32_t imageIdx, const dwRect *ROI,
229  const dwTransformation2D *outputToObject, dwObjectDetectorHandle_t obj);
230 
246 dwStatus dwObjectDetector_getROI(dwRect *ROI, dwTransformation2D *outputToObject, uint32_t imageIdx,
247  dwObjectDetectorHandle_t obj);
248 
270  uint32_t numImages, dwObjectDetectorHandle_t obj);
271 
282 dwStatus dwObjectDetector_interpretHost(uint32_t numImages, dwObjectDetectorHandle_t obj);
283 
298 dwStatus dwObjectDetector_getDetectedObjects(dwObject *objectList, size_t *numObjects, uint32_t imageIdx,
299  uint32_t classIdx, dwObjectDetectorHandle_t obj);
300 
310 dwStatus dwObjectDetector_setCUDAStream(cudaStream_t stream, dwObjectDetectorHandle_t obj);
311 
321 dwStatus dwObjectDetector_getCUDAStream(cudaStream_t *stream, dwObjectDetectorHandle_t obj);
322 
323 
331 dwStatus dwObjectDetector_isFuseObjectsEnabled(dwBool *enabled, dwObjectDetectorHandle_t obj);
332 
340 dwStatus dwObjectDetector_setEnableFuseObjects(dwBool enable, dwObjectDetectorHandle_t obj);
341 
350 dwStatus dwObjectDetector_getCoverageThreshold(float32_t *covThreshold, uint32_t classIdx,
351  dwObjectDetectorHandle_t obj);
352 
361 dwStatus dwObjectDetector_setCoverageThreshold(float32_t covThreshold, uint32_t classIdx,
362  dwObjectDetectorHandle_t obj);
363 
364 #ifdef __cplusplus
365 }
366 #endif
367 
368 #endif // DW_OBJECT_DETECTOR_H__
dwBool enableBoundingBoxClipping
If enableBoundingBoxClipping is set to DW_TRUE, the bounding boxes are clipped to the image edges...
Definition: Detector.h:122
float float32_t
Specifies POD types.
Definition: Types.h:77
Defines a rectangle.
Definition: Types.h:151
DW_API_PUBLIC dwStatus dwObjectDetector_setCUDAStream(cudaStream_t stream, dwObjectDetectorHandle_t obj)
Sets the CUDA stream used.
uint32_t maxNumImages
Maximum number of images (cannot be larger than DW_DETECTOR_MAX_IMAGES). Default is 1...
Definition: Detector.h:104
DW_API_PUBLIC dwStatus dwObjectDetector_setROI(uint32_t imageIdx, const dwRect *ROI, const dwTransformation2D *outputToObject, dwObjectDetectorHandle_t obj)
Sets the region of interest for an image at given index, and the 2D transformation from the image coo...
DW_API_PUBLIC dwStatus dwObjectDetector_initializeFromDriveNet(dwObjectDetectorHandle_t *obj, dwContextHandle_t ctx, dwDriveNetHandle_t drivenet, const dwObjectDetectorParams *detectorParams)
Initializes ObjectDetector module with a DriveNet module.
dwBool enable2_5D
Whether the network can predict object orientation.
Definition: Detector.h:95
const char * horizontalVisBlobName
Name of the horizontal visibility layer. Default is empty string.
Definition: Detector.h:91
Defines a CUDA image.
Definition: Image.h:263
struct dwObjectDetectorObject * dwObjectDetectorHandle_t
Handle to an object detector.
Definition: Detector.h:67
DW_API_PUBLIC dwStatus dwObjectDetector_initDefaultParams(dwObjectDetectorDNNParams *dnnParams, dwObjectDetectorParams *detectorParams)
Initializes ObjectDetector parameters with default values.
NVIDIA DriveWorks API: Core Methods
struct dwDriveNetObject * dwDriveNetHandle_t
Handle to a DriveNet object.
Definition: DriveNet.h:61
DW_API_PUBLIC dwStatus dwObjectDetector_inferDeviceAsync(const dwImageCUDA *const *imageArray, uint32_t numImages, dwObjectDetectorHandle_t obj)
Runs inference using the provided DNN model.
#define DW_OBJECT_DETECTOR_MAX_IMAGES
Maximum number of images to run detector on.
Definition: Detector.h:61
DW_API_PUBLIC dwStatus dwObjectDetector_interpretHost(uint32_t numImages, dwObjectDetectorHandle_t obj)
Output of the inference (dwObjectDetector_inferDeviceAsync) is interpreted to get the list of object ...
DW_API_PUBLIC dwStatus dwObjectDetector_release(dwObjectDetectorHandle_t *obj)
Releases the ObjectDetector module.
NVIDIA DriveWorks API: DNN Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
dwStatus
Status definition.
Definition: Status.h:167
const char * orientationYawBlobName
Name of the orientation yaw layer. Default is empty string.
Definition: Detector.h:93
uint32_t maxProposalsPerClass
Maximum number of RAW detections directly obtained from DNN. Default is 100.
Definition: Detector.h:83
NVIDIA DriveWorks API: Data Conditioner Methods
DW_API_PUBLIC dwStatus dwObjectDetector_isFuseObjectsEnabled(dwBool *enabled, dwObjectDetectorHandle_t obj)
Returns a boolean indicating whether object fusing is enabled.
DW_API_PUBLIC dwStatus dwObjectDetector_getCoverageThreshold(float32_t *covThreshold, uint32_t classIdx, dwObjectDetectorHandle_t obj)
Get coverage threshold for a given class.
DW_API_PUBLIC dwStatus dwObjectDetector_setEnableFuseObjects(dwBool enable, dwObjectDetectorHandle_t obj)
Enables or disables objectFusing.
float32_t boxScaleY1
Scale coefficient for Y coordinates of upper-left corner of the RAW bounding box from DNN output...
Definition: Detector.h:75
DW_API_PUBLIC dwStatus dwObjectDetector_setCoverageThreshold(float32_t covThreshold, uint32_t classIdx, dwObjectDetectorHandle_t obj)
Set coverage threshold for a given class.
dwBool enableFuseObjects
If enableFuseObjects is set to DW_TRUE, all the objects proposals coming from all the images are trea...
Definition: Detector.h:118
DW_API_PUBLIC dwStatus dwObjectDetector_getROI(dwRect *ROI, dwTransformation2D *outputToObject, uint32_t imageIdx, dwObjectDetectorHandle_t obj)
Returns the region of interest and the 2D transformation from the image coordinate system to object c...
const char * bottomVisBlobName
Name of the bottom visibility layer. Default is empty string.
Definition: Detector.h:89
NVIDIA DriveWorks API: DriveNet Module
struct dwDNNObject * dwDNNHandle_t
Handles representing Deep Neural Network interface.
Definition: DNN.h:63
uint8_t dwBool
Definition: Types.h:79
float32_t boxScaleX1
Scale coefficient for X coordinate of upper-left corner of the RAW bounding box from DNN output...
Definition: Detector.h:72
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
DW_API_PUBLIC dwStatus dwObjectDetector_reset(dwObjectDetectorHandle_t obj)
Resets ObjectDetector.
NVIDIA DriveWorks API: Object Methods
dwDataConditionerParams dataConditionerParams
DataConditioner parameters.
Definition: Detector.h:99
float32_t boxScaleX2
Scale coefficient for X coordinate of lower-right corner of the RAW bounding box from DNN output...
Definition: Detector.h:78
DW_API_PUBLIC dwStatus dwObjectDetector_initialize(dwObjectDetectorHandle_t *obj, dwContextHandle_t ctx, dwDNNHandle_t dnn, const dwObjectDetectorDNNParams *dnnParams, const dwObjectDetectorParams *detectorParams)
Initializes ObjectDetector module with a preloaded DNN inference module.
#define DW_OBJECT_MAX_CLASSES
Maximum number of classes that a network can detect.
Definition: Object.h:57
const char * boundingBoxBlobName
Name of the bounding box layer. Default is empty string.
Definition: Detector.h:87
float32_t boxScaleY2
Scale coefficient for Y coordinates of lower-right corner of the RAW bounding box from DNN output...
Definition: Detector.h:81
DW_API_PUBLIC dwStatus dwObjectDetector_getCUDAStream(cudaStream_t *stream, dwObjectDetectorHandle_t obj)
Gets the CUDA stream used.
#define DW_API_PUBLIC
Definition: Exports.h:76
DW_API_PUBLIC dwStatus dwObjectDetector_getDetectedObjects(dwObject *objectList, size_t *numObjects, uint32_t imageIdx, uint32_t classIdx, dwObjectDetectorHandle_t obj)
Returns detected objects for one of the images given to dwObjectDetector_inferDeviceAsync.
const char * coverageBlobName
Name of the coverage layer. Default is empty string.
Definition: Detector.h:85