派生自 libgowrapper/yolo

zhangmeng
2019-12-11 b63c8219736016e3b3952465f41abede37a38fbd
csrc/yolo.h
@@ -1,9 +1,6 @@
#ifndef _cpp_yolo_h_
#define _cpp_yolo_h_
#include <vector>
#include <string>
#include "struct.h"
struct image_t;
@@ -12,30 +9,12 @@
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