| | |
| | | #ifndef _cpp_yolo_h_ |
| | | #define _cpp_yolo_h_ |
| | | |
| | | #include <vector> |
| | | #include <string> |
| | | |
| | | #include "struct.h" |
| | | |
| | | struct image_t; |
| | |
| | | |
| | | namespace cppyolo |
| | | { |
| | | class sdkyolo{ |
| | | void *init(const char *cfg, const char *weights, const char *name, const int gpu); |
| | | void release(void *handle); |
| | | |
| | | public: |
| | | sdkyolo(const char *cfg, const char *weights, const char *name, const int gpu); |
| | | ~sdkyolo(); |
| | | int detect(void *handle, const cIMAGE *img, const float thrsh, const bool use_mean, void **objs, int *objCount); |
| | | const char* obj_name_by_type(const int typ); |
| | | |
| | | public: |
| | | int detect(const cIMAGE *img, const float thrsh, const bool use_mean, void **objs, int *objCount); |
| | | const char* obj_name_by_type(const int typ)const; |
| | | private: |
| | | bool init(const char *cfg, const char *weights, const char *name, const int gpu); |
| | | int buffer_to_image(const unsigned char *data, const int w, const int h, const int color_channel); |
| | | |
| | | private: |
| | | Detector *det_; |
| | | cObjInfo *infos_; |
| | | int obj_cnt_; |
| | | std::vector<std::string> names_; |
| | | |
| | | image_t *image_; |
| | | int width_; |
| | | int height_; |
| | | int channel_; |
| | | }; |
| | | } // namespace cppyolo |
| | | |
| | | |