xref: /OK3568_Linux_fs/external/rknpu2/examples/RV1106_RV1103/rknn_yolov5_demo/include/postprocess.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 #ifndef _RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_
2 #define _RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_
3 
4 #include <stdint.h>
5 
6 #define OBJ_NAME_MAX_SIZE 16
7 #define OBJ_NUMB_MAX_SIZE 64
8 #define OBJ_CLASS_NUM     80
9 #define NMS_THRESH        0.45
10 #define BOX_THRESH        0.25
11 #define PROP_BOX_SIZE     (5+OBJ_CLASS_NUM)
12 
13 typedef struct _BOX_RECT
14 {
15     int left;
16     int right;
17     int top;
18     int bottom;
19 } BOX_RECT;
20 
21 typedef struct __detect_result_t
22 {
23     char name[OBJ_NAME_MAX_SIZE];
24     BOX_RECT box;
25     float prop;
26 } detect_result_t;
27 
28 typedef struct _detect_result_group_t
29 {
30     int id;
31     int count;
32     detect_result_t results[OBJ_NUMB_MAX_SIZE];
33 } detect_result_group_t;
34 
35 int post_process(int8_t *input0, int8_t *input1, int8_t *input2, int model_in_h, int model_in_w,
36                  float conf_threshold, float nms_threshold, float scale_w, float scale_h,
37                  std::vector<int32_t> &qnt_zps, std::vector<float> &qnt_scales,
38                  detect_result_group_t *group);
39 
40 #endif //_RKNN_ZERO_COPY_DEMO_POSTPROCESS_H_
41