mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Merge pull request #2394 from cenit/dev/cenit/yoloAlexey_v2
improve compatibility with c++ compilers
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
#pragma once
|
||||
#ifndef YOLO_V2_CLASS_HPP
|
||||
#define YOLO_V2_CLASS_HPP
|
||||
|
||||
#ifndef LIB_API
|
||||
#ifdef LIB_EXPORTS
|
||||
#if defined(_MSC_VER)
|
||||
#define LIB_API __declspec(dllexport)
|
||||
@ -12,23 +15,25 @@
|
||||
#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
|
||||
};
|
||||
|
||||
#define C_SHARP_MAX_OBJECTS 1000
|
||||
struct bbox_t_container {
|
||||
bbox_t candidates[C_SHARP_MAX_OBJECTS];
|
||||
};
|
||||
@ -41,9 +46,9 @@ struct bbox_t_container {
|
||||
|
||||
#ifdef OPENCV
|
||||
#include <opencv2/opencv.hpp> // C++
|
||||
#include "opencv2/highgui/highgui_c.h" // C
|
||||
#include "opencv2/imgproc/imgproc_c.h" // C
|
||||
#endif // OPENCV
|
||||
#include <opencv2/highgui/highgui_c.h> // C
|
||||
#include <opencv2/imgproc/imgproc_c.h> // C
|
||||
#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);
|
||||
@ -658,3 +663,4 @@ void free_img(image_t m) {
|
||||
|
||||
#endif // __cplusplus
|
||||
*/
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user