#ifdef __cplusplus extern "C"{ #endif #include "cyolo.h" #ifdef __cplusplus } #endif #include "csrc/yolo.h" #include "csrc/struct.h" #include "csrc/yolo.cpp" using namespace cppyolo; void* init(const char *cfg, const char *weights, const char *name, const int gpu){ return new sdkyolo(cfg, weights, name, gpu); } void release(void *handle){ if (handle){ sdkyolo *h = (sdkyolo*)handle; delete h; } } int detect(void *handle, const void *data, const int w, const int h, const int c, const float thrsh, const int use_mean, void **objInfos, int *objCount){ sdkyolo *y = (sdkyolo*)handle; cIMAGE img{(unsigned char*)data, w, h, c}; return y->detect(&img, thrsh, use_mean, objInfos, objCount); } const char* obj_name_by_type(void *handle, const int typ){ sdkyolo *h = (sdkyolo*)handle; return h->obj_name_by_type(typ); }