-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathyolo_encode.h
56 lines (46 loc) · 1.12 KB
/
yolo_encode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef YOLO_ENCODE_H
#define YOLO_ENCODE_H
#include "plugins/layerparams_tool.h"
#include "NvInfer.h"
namespace yolo{
typedef struct _NormalizedBBox{
float xmin;
float ymin;
float xmax;
float ymax;
float clas;
float score;
bool operator <(const _NormalizedBBox &tmp) const{
return score < tmp.score;
}
} NormalizedBBox;
template <typename Dtype>
class YoloEncode{
public:
YoloEncode(nvinfer1::Dims const& encode_dims
, int net_w
, int net_h
, int classes
, float objThresh
, YoloKernel const& yolo_kernel);
~YoloEncode();
int encode(Dtype *data, cudaStream_t stream);
float *normBoxData(){
return m_normBox;
}
private:
int m_net_w{};
int m_net_h{};
//yolo kernel w,h,c
int m_w{};
int m_h{};
int m_c{};
int m_priorNum{};
int m_boxNum{};
int m_classes{};
float m_objThresh{};
Dtype *m_anchors{};
float *m_normBox{};
};
}
#endif