Files
yolov5-inferrence/postprocess.h

37 lines
974 B
C++

#ifndef _RKNN_YOLOV5_DEMO_POSTPROCESS_H_
#define _RKNN_YOLOV5_DEMO_POSTPROCESS_H_
#include <stdint.h>
#include <vector>
#include "rknn_api.h"
#include "common.h"
#include "yolov5.h"
#define RKNPU1
// #define PROP_BOX_SIZE (5 + OBJ_CLASS_NUM)
extern int OBJ_CLASS_REAL_NUM;
extern int PROP_BOX_SIZE;
// 当刚从time_gap离开,需要重置一下帧数等信息,从而再下次进入区间,表现正常
extern int inited_after_out_of_time_gap;
extern char *labels[OBJ_MAX_CLASS_NUM];
extern int codes[OBJ_MAX_CLASS_NUM];
// class rknn_app_context_t;
typedef struct {
int x_pad;
int y_pad;
float scale;
} letterbox_t;
int init_post_process();
void deinit_post_process();
const char *coco_cls_to_name(int cls_id);
int post_process(rknn_app_context_t *app_ctx, void *outputs, letterbox_t *letter_box, float conf_threshold, float nms_threshold, object_detect_result_list *od_results);
void deinitPostProcess();
#endif //_RKNN_YOLOV5_DEMO_POSTPROCESS_H_