postprocess.h 1.0 KB

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