AlexeyAB
2018-01-17 54f83e153549dd1a63bcc8fa5e55fb171621a989
src/demo.c
@@ -7,16 +7,23 @@
#include "box.h"
#include "image.h"
#include "demo.h"
//#include <sys/time.h>
#ifdef WIN32
#include <time.h>
#include <winsock.h>
#include "gettimeofday.h"
#else
#include <sys/time.h>
#endif
#define FRAMES 3
#ifdef OPENCV
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/core/version.hpp"
#ifndef CV_VERSION_EPOCH
#include "opencv2/videoio/videoio_c.h"
#endif
image get_image_from_stream(CvCapture *cap);
static char **demo_names;
@@ -108,7 +115,7 @@
    return (double)time.tv_sec + (double)time.tv_usec * .000001;
}
void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix)
void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename)
{
    //skip = frame_skip;
    image **alphabet = load_alphabet();
@@ -118,7 +125,7 @@
    demo_classes = classes;
    demo_thresh = thresh;
    printf("Demo\n");
    net = parse_network_cfg(cfgfile);
    net = parse_network_cfg_custom(cfgfile, 1);
    if(weightfile){
        load_weights(&net, weightfile);
    }
@@ -187,7 +194,7 @@
            if(!prefix){                
            //show_image(disp, "Demo");
            show_image_cv_ipl(show_img, "Demo");
            show_image_cv_ipl(show_img, "Demo", out_filename);
                int c = cvWaitKey(1);
                if (c == 10){
                    if(frame_skip == 0) frame_skip = 60;
@@ -237,7 +244,7 @@
    }
}
#else
void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix)
void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename)
{
    fprintf(stderr, "Demo needs OpenCV for webcam images.\n");
}