| | |
| | | #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); |
| | | void draw_yolo(image im, int num, float thresh, box *boxes, float **probs); |
| | | |
| | | extern char *voc_names[]; |
| | | extern image voc_labels[]; |
| | |
| | | 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"); |
| | |
| | | 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); |