yolo.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _YOLOV_H_
  2. #define _YOLOV_H_
  3. #include "eznn_api.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif /* __cplusplus */
  7. const char *yolov_labels_name[1] = {
  8. "face"
  9. };
  10. typedef enum ezax_yolo_model {
  11. EZAX_MODEL_YOLOV3,
  12. EZAX_MODEL_YOLOV5,
  13. } ezax_yolo_model_t;
  14. typedef struct eazx_pets_det_cfg {
  15. char *model_rootpath;
  16. int model_type;
  17. int width;
  18. int height;
  19. } ezax_pets_det_cfg_t;
  20. typedef struct ax_nna_tensor
  21. {
  22. /* vir and phy addr */
  23. void *pVir; unsigned pPhy;
  24. /* data size */
  25. int nDatasz;
  26. /* tensor width, height, channel, batch number, fraction point */
  27. int w; int h; int c; int n; int fl;
  28. /* 2: int8, 4 int16 */
  29. int dtype;
  30. /* tensor name */
  31. char nTensorName[32];
  32. /* reserved */
  33. int rzv;
  34. }ax_nna_tensor_t;
  35. typedef struct ax_nna_tensors
  36. {
  37. /* tensor pointer */
  38. ax_nna_tensor_t *nTensor;
  39. /* tensor number */
  40. int nTensorNum;
  41. }ax_nna_tensors_t;
  42. typedef enum ezax_yolo_cmd {
  43. EZAX_YOLO_RESET_AXFREQ,
  44. EZAX_YOLO_GET_AXFREQ,
  45. } ezax_yolo_cmd_t;
  46. void *nna_pets_det_open(ezax_pets_det_cfg_t *cfg);
  47. int nna_pets_det_cmd(void *hdl, ezax_yolo_cmd_t cmd,unsigned int args);
  48. int nna_pets_det_process(void *hdl,ezax_img_t *pImg,ezax_boxes_t *yolo_det_out,float conf_thresh,float iou_thresh);
  49. int nna_pets_det_close(void *hdl);
  50. #ifdef __cplusplus
  51. }
  52. #endif /* __cplusplus */
  53. #endif