| | |
| | | #include "demo.h" |
| | | #include <sys/time.h> |
| | | |
| | | #define FRAMES 1 |
| | | #define FRAMES 3 |
| | | |
| | | #ifdef OPENCV |
| | | #include "opencv2/highgui/highgui_c.h" |
| | |
| | | |
| | | void *detect_in_thread(void *ptr) |
| | | { |
| | | float nms = .4; |
| | | float nms = .1; |
| | | |
| | | detection_layer l = net.layers[net.n-1]; |
| | | float *X = det_s.data; |
| | |
| | | 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"); |
| | | |
| | | if(1){ |
| | | show_image(disp, "Demo"); |
| | | int c = cvWaitKey(1); |
| | | if (c == 10){ |
| | |
| | | else if(frame_skip == 60) frame_skip = 4; |
| | | else frame_skip = 0; |
| | | } |
| | | }else{ |
| | | char buff[256]; |
| | | sprintf(buff, "/home/pjreddie/tmp/bag_%07d", count); |
| | | save_image(disp, buff); |
| | | } |
| | | |
| | | pthread_join(fetch_thread, 0); |
| | | pthread_join(detect_thread, 0); |