mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
updates and things
This commit is contained in:
24
src/demo.c
24
src/demo.c
@ -8,7 +8,7 @@
|
||||
#include "demo.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
#define FRAMES 1
|
||||
#define FRAMES 3
|
||||
|
||||
#ifdef OPENCV
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
@ -48,7 +48,7 @@ void *fetch_in_thread(void *ptr)
|
||||
|
||||
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;
|
||||
@ -153,13 +153,19 @@ void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const ch
|
||||
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, "Demo");
|
||||
int c = cvWaitKey(1);
|
||||
if (c == 10){
|
||||
if(frame_skip == 0) frame_skip = 60;
|
||||
else if(frame_skip == 4) frame_skip = 0;
|
||||
else if(frame_skip == 60) frame_skip = 4;
|
||||
else frame_skip = 0;
|
||||
if(1){
|
||||
show_image(disp, "Demo");
|
||||
int c = cvWaitKey(1);
|
||||
if (c == 10){
|
||||
if(frame_skip == 0) frame_skip = 60;
|
||||
else if(frame_skip == 4) frame_skip = 0;
|
||||
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);
|
||||
|
Reference in New Issue
Block a user