detector.h 793 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __DETECTOR_H__
  2. #define __DETECTOR_H__
  3. #include <stdint.h>
  4. #define MAX_DETECTIONS 200
  5. typedef struct {
  6. float x1, y1, x2, y2;
  7. float score;
  8. int label;
  9. } DetResult;
  10. typedef struct Detector Detector;
  11. Detector *detector_create(const char *model_path, float conf_thresh, float nms_thresh);
  12. void detector_destroy(Detector *det);
  13. int detector_get_input_width(Detector *det);
  14. int detector_get_input_height(Detector *det);
  15. int detector_detect(Detector *det, int src_nv12_fd, int src_w, int src_h,
  16. DetResult *results, int *num_results);
  17. void detector_draw_one_result(DetResult *r, void *y_plane, int out_w, int out_h,
  18. int tile_x, int tile_y, int tile_w, int tile_h,
  19. int src_w, int src_h);
  20. #endif