From 698d54cb5f7f490eeeffa6d91936a829085a13cc Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Mon, 26 Mar 2018 08:57:43 -0700 Subject: [PATCH] YOLOv3 ON CPU!!!! --- examples/detector.c | 4 ++-- src/blas.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/detector.c b/examples/detector.c index 685b8705..72a88e85 100644 --- a/examples/detector.c +++ b/examples/detector.c @@ -572,7 +572,7 @@ void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filenam double time; char buff[256]; char *input = buff; - float nms=.3; + float nms=0; while(1){ if(filename){ strncpy(input, filename, 256); @@ -598,7 +598,7 @@ void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filenam printf("%s: Predicted in %f seconds.\n", input, what_time_is_it_now()-time); int nboxes = 0; detection *dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, 0, 1, &nboxes); - printf("%d\n", nboxes); + //printf("%d\n", nboxes); //if (nms) do_nms_obj(boxes, probs, l.w*l.h*l.n, l.classes, nms); if (nms) do_nms_sort(dets, nboxes, l.classes, nms); draw_detections(im, dets, nboxes, thresh, names, alphabet, l.classes); diff --git a/src/blas.c b/src/blas.c index a1bb5554..9e160444 100644 --- a/src/blas.c +++ b/src/blas.c @@ -339,7 +339,7 @@ void upsample_cpu(float *in, int w, int h, int c, int batch, int stride, int for for(j = 0; j < h*stride; ++j){ for(i = 0; i < w*stride; ++i){ int in_index = b*w*h*c + k*w*h + (j/stride)*w + i/stride; - int out_index = b*w*h*c + k*w*h + j*w + i; + int out_index = b*w*h*c*stride*stride + k*w*h*stride*stride + j*w*stride + i; if(forward) out[out_index] = scale*in[in_index]; else in[in_index] += scale*out[out_index]; }