FIX OPENCV 🐍

This commit is contained in:
Joseph Redmon
2017-09-19 15:02:39 -07:00
parent 1e729804f6
commit a4ae313b1c
2 changed files with 3 additions and 2 deletions

View File

@ -89,12 +89,12 @@ void speed(char *cfgfile, int tics)
network net = parse_network_cfg(cfgfile); network net = parse_network_cfg(cfgfile);
set_batch_network(&net, 1); set_batch_network(&net, 1);
int i; 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); image im = make_image(net.w, net.h, net.c*net.batch);
for(i = 0; i < tics; ++i){ for(i = 0; i < tics; ++i){
network_predict(net, im.data); 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("\n%d evals, %f Seconds\n", tics, t);
printf("Speed: %f sec/eval\n", t/tics); printf("Speed: %f sec/eval\n", t/tics);
printf("Speed: %f Hz\n", tics/t); printf("Speed: %f Hz\n", tics/t);

View File

@ -27,6 +27,7 @@ extern int gpu_index;
#include "opencv2/core/version.hpp" #include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION == 3 #if CV_MAJOR_VERSION == 3
#include "opencv2/videoio/videoio_c.h" #include "opencv2/videoio/videoio_c.h"
#include "opencv2/imgcodecs/imgcodecs_c.h"
#endif #endif
#endif #endif
#endif #endif