NVIDIA DeepStream SDK API Reference

8.0 Release
decoder.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef DECODER_HPP
14 #define DECODER_HPP
15 
16 #include <memory>
17 #include <vector>
18 #include "dtype.hpp"
19 
20 namespace bevfusion{
21 namespace decoder{
22 
23 struct Position {
24  float x, y, z;
25 };
26 
27 struct Size {
28  float w, l, h; // x, y, z
29 };
30 
31 struct Velocity {
32  float vx, vy;
33 };
34 
35 struct ThreeDBox {
39  float yaw;
40  float score;
41  int category;
42  int ibatch;
43  int id;
44 };
45 
46 typedef struct ThreeDBox ThreeDBox;
47 typedef std::vector<ThreeDBox> ThreeDBoxes;
48 
49 struct Head{
50  void* heatmap;
51  void* rotation;
52  void* height;
53  void* dim;
54  void* vel;
55  void* reg;
56  unsigned int fm_area;
57  unsigned int fm_width;
58  unsigned int batch;
59 };
60 
61 class Decoder {
62 public:
64  float out_size_factor = 4;
65  ds3d::Float2 voxel_size{0.075, 0.075};
66  ds3d::Float2 pc_range{-54.0f, -54.0f};
67  ds3d::Float3 post_center_range_start{-61.2, -61.2, -10.0};
69  unsigned int num_classes = 5;
70  };
71 
72 public:
73  static std::unique_ptr<Decoder> createDecoder(const DecoderParameter& param);
74  virtual bool init(const Decoder::DecoderParameter& param) = 0;
75  virtual ThreeDBoxes forward(
76  const std::vector<Head>& heads,
77  float confidence_threshold, float nms_threshold, void* stream) = 0;
78  virtual ~Decoder() = default;
79 };
80 
81 };
82 }; // bevfusion
83 
84 #endif // DECODER_HPP
bevfusion::decoder::Decoder::DecoderParameter::post_center_range_end
ds3d::Float3 post_center_range_end
Definition: decoder.hpp:68
bevfusion
Definition: voxelization.hpp:19
bevfusion::decoder::Head::vel
void * vel
Definition: decoder.hpp:54
bevfusion::decoder::Position::x
float x
Definition: decoder.hpp:24
bevfusion::decoder::Velocity
Definition: decoder.hpp:31
bevfusion::decoder::Head
Definition: decoder.hpp:49
bevfusion::decoder::ThreeDBox
Definition: decoder.hpp:35
bevfusion::decoder::Decoder::DecoderParameter::post_center_range_start
ds3d::Float3 post_center_range_start
Definition: decoder.hpp:67
bevfusion::decoder::Head::fm_area
unsigned int fm_area
Definition: decoder.hpp:56
bevfusion::decoder::Head::heatmap
void * heatmap
Definition: decoder.hpp:50
bevfusion::decoder::Position
Definition: decoder.hpp:23
bevfusion::decoder::ThreeDBox::ibatch
int ibatch
Definition: decoder.hpp:42
bevfusion::decoder::Decoder::DecoderParameter::num_classes
unsigned int num_classes
Definition: decoder.hpp:69
bevfusion::decoder::Decoder::DecoderParameter::out_size_factor
float out_size_factor
Definition: decoder.hpp:64
bevfusion::decoder::Head::dim
void * dim
Definition: decoder.hpp:53
bevfusion::decoder::Size::l
float l
Definition: decoder.hpp:28
bevfusion::decoder::Size::w
float w
Definition: decoder.hpp:28
bevfusion::decoder::ThreeDBox::size
Size size
Definition: decoder.hpp:37
bevfusion::decoder::Decoder::init
virtual bool init(const Decoder::DecoderParameter &param)=0
bevfusion::decoder::Decoder
Definition: decoder.hpp:61
bevfusion::decoder::ThreeDBox::category
int category
Definition: decoder.hpp:41
bevfusion::decoder::ThreeDBoxes
std::vector< ThreeDBox > ThreeDBoxes
Definition: decoder.hpp:47
bevfusion::decoder::Head::rotation
void * rotation
Definition: decoder.hpp:51
bevfusion::decoder::Decoder::DecoderParameter::voxel_size
ds3d::Float2 voxel_size
Definition: decoder.hpp:65
ds3d::Float2
Definition: dtype.hpp:39
bevfusion::decoder::Position::z
float z
Definition: decoder.hpp:24
bevfusion::decoder::ThreeDBox::score
float score
Definition: decoder.hpp:40
bevfusion::decoder::Decoder::createDecoder
static std::unique_ptr< Decoder > createDecoder(const DecoderParameter &param)
bevfusion::decoder::Decoder::~Decoder
virtual ~Decoder()=default
bevfusion::decoder::Decoder::DecoderParameter
Definition: decoder.hpp:63
bevfusion::decoder::Head::reg
void * reg
Definition: decoder.hpp:55
bevfusion::decoder::Head::batch
unsigned int batch
Definition: decoder.hpp:58
bevfusion::decoder::Position::y
float y
Definition: decoder.hpp:24
ds3d::Float3
Definition: dtype.hpp:46
bevfusion::decoder::Size
Definition: decoder.hpp:27
bevfusion::decoder::Decoder::DecoderParameter::pc_range
ds3d::Float2 pc_range
Definition: decoder.hpp:66
bevfusion::decoder::Decoder::forward
virtual ThreeDBoxes forward(const std::vector< Head > &heads, float confidence_threshold, float nms_threshold, void *stream)=0
bevfusion::decoder::ThreeDBox::id
int id
Definition: decoder.hpp:43
bevfusion::decoder::Velocity::vx
float vx
Definition: decoder.hpp:32
dtype.hpp
bevfusion::decoder::ThreeDBox::velocity
Velocity velocity
Definition: decoder.hpp:38
bevfusion::decoder::ThreeDBox::position
Position position
Definition: decoder.hpp:36
bevfusion::decoder::Head::fm_width
unsigned int fm_width
Definition: decoder.hpp:57
bevfusion::decoder::Head::height
void * height
Definition: decoder.hpp:52
bevfusion::decoder::Size::h
float h
Definition: decoder.hpp:28
bevfusion::decoder::ThreeDBox::yaw
float yaw
Definition: decoder.hpp:39
bevfusion::decoder::Velocity::vy
float vy
Definition: decoder.hpp:32