#ifndef __CORTEX_BOX_HEADER__ #define __CORTEX_BOX_HEADER__ #include /* typedef struct{ float x, y, w, h; } box; typedef struct{ float dx, dy, dw, dh; } dbox; box float_to_box(float *f); float box_iou(box a, box b); float box_rmse(box a, box b); dbox diou(box a, box b); void do_nms(box *boxes, float **probs, int total, int classes, float thresh); void do_nms_sort(box *boxes, float **probs, int total, int classes, float thresh); box decode_box(box b, box anchor); box encode_box(box b, box anchor); */ typedef struct S_BOXLABEL{ uint32_t id; float x, y, w, h; float left, right, top, bottom; void _float(float *val); float _intersection(S_BOXLABEL b); float _union(S_BOXLABEL b); void _encode(S_BOXLABEL anchor); void _decode(S_BOXLABEL anchor); float _iou(S_BOXLABEL b); float _rmse(S_BOXLABEL b); } cortexBOXLABEL; typedef struct S_DBOX{ float dx, dy, dw, dh; void _derivative(S_BOXLABEL a, S_BOXLABEL b); void _intersect(S_BOXLABEL a, S_BOXLABEL b); void _union(S_BOXLABEL a, S_BOXLABEL b); void _iou(S_BOXLABEL a, S_BOXLABEL b); } cortexDBOX; typedef struct S_SORTABLE_DBOX{ uint32_t index; uint32_t cls; float **probs; } cortexSortableDBOX; void nmsSort(S_BOXLABEL *boxes, float **probs, uint32_t total, uint32_t classes, float thresh); void doNMS(S_BOXLABEL *boxes, float **probs, uint32_t total, uint32_t classes, float thresh); #endif