From a4ae313b1c03915ac0c380fddc4b34f4f3707b52 Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Tue, 19 Sep 2017 15:02:39 -0700 Subject: [PATCH] FIX OPENCV :snake: --- examples/darknet.c | 4 ++-- include/darknet.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/darknet.c b/examples/darknet.c index 8e44df12..e63afef8 100644 --- a/examples/darknet.c +++ b/examples/darknet.c @@ -89,12 +89,12 @@ void speed(char *cfgfile, int tics) network net = parse_network_cfg(cfgfile); set_batch_network(&net, 1); int i; - time_t start = time(0); + double time=what_time_is_it_now(); image im = make_image(net.w, net.h, net.c*net.batch); for(i = 0; i < tics; ++i){ network_predict(net, im.data); } - double t = difftime(time(0), start); + double t = what_time_is_it_now() - time; printf("\n%d evals, %f Seconds\n", tics, t); printf("Speed: %f sec/eval\n", t/tics); printf("Speed: %f Hz\n", tics/t); diff --git a/include/darknet.h b/include/darknet.h index cdf3cc66..336ed6f6 100644 --- a/include/darknet.h +++ b/include/darknet.h @@ -27,6 +27,7 @@ extern int gpu_index; #include "opencv2/core/version.hpp" #if CV_MAJOR_VERSION == 3 #include "opencv2/videoio/videoio_c.h" + #include "opencv2/imgcodecs/imgcodecs_c.h" #endif #endif #endif