t1
Joseph Redmon
2016-06-20 ab75d5c5783db4792e400f933d584984f3aa7bf0
src/yolo_demo.c
@@ -8,8 +8,8 @@
#include <sys/time.h>
#ifdef OPENCV
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
image ipl_to_image(IplImage* src);
void convert_yolo_detections(float *predictions, int classes, int num, int square, int side, int w, int h, float thresh, float **probs, box *boxes, int only_objectness);
@@ -98,6 +98,7 @@
    while(1){
        struct timeval tval_before, tval_after, tval_result;
        gettimeofday(&tval_before, NULL);
        /*
        if(pthread_create(&fetch_thread, 0, fetch_in_thread, 0)) error("Thread creation failed");
        if(pthread_create(&detect_thread, 0, detect_in_thread, 0)) error("Thread creation failed");
        show_image(disp, "YOLO");
@@ -109,6 +110,16 @@
        disp  = det;
        det   = in;
        det_s = in_s;
        */
        fetch_in_thread(0);
        det = in;
        det_s = in_s;
        detect_in_thread(0);
        disp = det;
        show_image(disp, "YOLO");
        free_image(disp);
        cvWaitKey(1);
        gettimeofday(&tval_after, NULL);
        timersub(&tval_after, &tval_before, &tval_result);