diff --git a/Makefile b/Makefile index 986759fe..9db41a88 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ NVCC=nvcc OPTS=-Ofast LDFLAGS= -lm -pthread COMMON= -CFLAGS=-Wall -Wfatal-errors -ffp-contract=fast -mavx +CFLAGS=-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -ffp-contract=fast -mavx ifeq ($(DEBUG), 1) OPTS=-O0 -g diff --git a/scripts/get_coco_dataset.sh b/scripts/get_coco_dataset.sh new file mode 100644 index 00000000..28463015 --- /dev/null +++ b/scripts/get_coco_dataset.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Clone COCO API +git clone https://github.com/pdollar/coco +cd coco + +mkdir images +cd images + +# Download Images +wget -c https://pjreddie.com/media/files/train2014.zip +wget -c https://pjreddie.com/media/files/val2014.zip + +# Unzip +unzip -q train2014.zip +unzip -q val2014.zip + +cd .. + +# Download COCO Metadata +wget -c https://pjreddie.com/media/files/instances_train-val2014.zip +wget -c https://pjreddie.com/media/files/coco/5k.part +wget -c https://pjreddie.com/media/files/coco/trainvalno5k.part +wget -c https://pjreddie.com/media/files/coco/labels.tgz +tar xzf labels.tgz +unzip -q instances_train-val2014.zip + +# Set Up Image Lists +paste <(awk "{print \"$PWD\"}" <5k.part) 5k.part | tr -d '\t' > 5k.txt +paste <(awk "{print \"$PWD\"}" trainvalno5k.txt + diff --git a/src/detector.c b/src/detector.c index 25968e66..6d7689ef 100644 --- a/src/detector.c +++ b/src/detector.c @@ -605,7 +605,7 @@ void validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, float int nboxes = 0; int letterbox = (args.type == LETTERBOX_DATA); float hier_thresh = 0; - detection *dets = get_network_boxes(&net, 1, 1, thresh, hier_thresh, 0, 1, &nboxes, letterbox); + detection *dets = get_network_boxes(&net, 1, 1, thresh, hier_thresh, 0, 0, &nboxes, letterbox); if (nms) do_nms_sort_v3(dets, nboxes, l.classes, nms); char labelpath[4096]; diff --git a/src/network.c b/src/network.c index 438829ac..8c713fb0 100644 --- a/src/network.c +++ b/src/network.c @@ -555,6 +555,9 @@ void custom_get_region_detections(layer l, int w, int h, int net_w, int net_h, f free(boxes); free_ptrs((void **)probs, l.w*l.h*l.n); + + //correct_region_boxes(dets, l.w*l.h*l.n, w, h, net_w, net_h, relative); + correct_yolo_boxes(dets, l.w*l.h*l.n, w, h, net_w, net_h, relative, letter); } void fill_network_boxes(network *net, int w, int h, float thresh, float hier, int *map, int relative, detection *dets, int letter) diff --git a/src/yolo_layer.h b/src/yolo_layer.h index fb9712aa..0c2f5016 100644 --- a/src/yolo_layer.h +++ b/src/yolo_layer.h @@ -11,6 +11,7 @@ void backward_yolo_layer(const layer l, network_state state); void resize_yolo_layer(layer *l, int w, int h); int yolo_num_detections(layer l, float thresh); int get_yolo_detections(layer l, int w, int h, int netw, int neth, float thresh, int *map, int relative, detection *dets, int letter); +void correct_yolo_boxes(detection *dets, int n, int w, int h, int netw, int neth, int relative, int letter); #ifdef GPU void forward_yolo_layer_gpu(const layer l, network_state state);