C functions to generate the bounding box from a feature map.
This requires library TensorLight to execute tensor computation. Check TensorLight for installation guide.
Use make
in this folder to compile test program then do the test.
Copy gen_bbox.h
and gen_bbox.c
in your project to use the functions.
#include "gen_bbox.h"
float *feature_map;
int img_width, img_height; /* original image size */
float bbox[4]; /* bounding box */
struct pre_alloc_tensors *tensors;
tensors = (struct pre_alloc_tensors *)gb_preprocess(); /* create necessary tensors */
feature_map = ...... /* compute feature_map */
gb_getbbox(feature_map, img_width, img_height, tensors, bbox); /* get bbox */
gb_postprocess(tensors); /* release tensors */