mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fully separate C-API from CPP-API
This commit is contained in:
@ -1,23 +1,37 @@
|
||||
#ifndef YOLO_V2_CLASS_HPP
|
||||
#define YOLO_V2_CLASS_HPP
|
||||
|
||||
#include "darknet.h"
|
||||
#ifndef LIB_API
|
||||
#ifdef LIB_EXPORTS
|
||||
#if defined(_MSC_VER)
|
||||
#define LIB_API __declspec(dllexport)
|
||||
#else
|
||||
#define LIB_API __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#if defined(_MSC_VER)
|
||||
#define LIB_API
|
||||
#else
|
||||
#define LIB_API
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define C_SHARP_MAX_OBJECTS 1000
|
||||
|
||||
struct bbox_t {
|
||||
unsigned int x, y, w, h; // (x,y) - top-left corner, (w, h) - width & height of bounded box
|
||||
unsigned int x, y, w, h; // (x,y) - top-left corner, (w, h) - width & height of bounded box
|
||||
float prob; // confidence - probability that the object was found correctly
|
||||
unsigned int obj_id; // class of object - from range [0, classes-1]
|
||||
unsigned int track_id; // tracking id for video (0 - untracked, 1 - inf - tracked object)
|
||||
unsigned int frames_counter;// counter of frames on which the object was detected
|
||||
unsigned int obj_id; // class of object - from range [0, classes-1]
|
||||
unsigned int track_id; // tracking id for video (0 - untracked, 1 - inf - tracked object)
|
||||
unsigned int frames_counter; // counter of frames on which the object was detected
|
||||
};
|
||||
|
||||
struct image_t {
|
||||
int h; // height
|
||||
int w; // width
|
||||
int c; // number of chanels (3 - for RGB)
|
||||
float *data; // pointer to the image data
|
||||
float *data; // pointer to the image data
|
||||
};
|
||||
|
||||
struct bbox_t_container {
|
||||
@ -34,7 +48,7 @@ struct bbox_t_container {
|
||||
#include <opencv2/opencv.hpp> // C++
|
||||
#include <opencv2/highgui/highgui_c.h> // C
|
||||
#include <opencv2/imgproc/imgproc_c.h> // C
|
||||
#endif // OPENCV
|
||||
#endif
|
||||
|
||||
extern "C" LIB_API int init(const char *configurationFilename, const char *weightsFilename, int gpu);
|
||||
extern "C" LIB_API int detect_image(const char *filename, bbox_t_container &container);
|
||||
|
Reference in New Issue
Block a user