-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_process.h
93 lines (77 loc) · 1.71 KB
/
post_process.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef __POST_PROCESS_H__
#define __POST_PROCESS_H__
#include "pmsis.h"
#include "Gap.h"
#define MAX_BB_OUT 50
//#define FLOAT_POST_PROCESS
#define POST_PROCESS_OUTPUT_REVERSED
#ifdef POST_PROCESS_OUTPUT_REVERSED
#define box_offset_y 1
#define box_offset_x 0
#define box_offset_height 3
#define box_offset_width 2
#define keypoint_offset_y 1
#define keypoint_offset_x 0
#else
#define box_offset_y 0
#define box_offset_x 1
#define box_offset_height 2
#define box_offset_width 3
#define keypoint_offset_y 0
#define keypoint_offset_x 1
#endif
#define keypoints_coord_offset 4
#define NON_MAX_THRES 0.5
#define Y_SCALE 128
#define X_SCALE 128
#define W_SCALE 128
#define H_SCALE 128
#define INV_X_SCALE_Q7 FP2FIX(0.0078125,7)
#define INV_Y_SCALE_Q7 FP2FIX(0.0078125,7)
#define INV_W_SCALE_Q7 FP2FIX(0.0078125,7)
#define INV_H_SCALE_Q7 FP2FIX(0.0078125,7)
typedef struct
{
int xmin;
int ymin;
int w;
int h;
float score;
uint8_t alive;
int k1_x; //Left eye
int k1_y;
int k2_x; //Right Eye
int k2_y;
int k3_x; // Nose
int k3_y;
int k4_x; // Mouth
int k4_y;
int k5_x; // Left Ear
int k5_y;
int k6_x; // Right Ear
int k6_y;
}bbox_t;
typedef struct
{
float xmin;
float ymin;
float w;
float h;
float score;
uint8_t alive;
float k1_x; //Left eye
float k1_y;
float k2_x; //Right Eye
float k2_y;
float k3_x; // Nose
float k3_y;
float k4_x; // Mouth
float k4_y;
float k5_x; // Left Ear
float k5_y;
float k6_x; // Right Ear
float k6_y;
}bbox_float_t;
void post_process(float* scores,float * boxes,bbox_float_t* bboxes,int img_w,int img_h, float thres);
void post_process_fix(int16_t* scores,int16_t * boxes,bbox_t* bboxes,int img_w,int img_h, int16_t thres);
#endif //__POST_PROCESS_H__