From 4d9a2bdac688f9c949b304dde8188a40efce1b49 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Wed, 11 Apr 2018 20:04:23 +0000
Subject: [PATCH] Minor fixes
---
src/network.c | 3 +++
scripts/get_coco_dataset.sh | 31 +++++++++++++++++++++++++++++++
Makefile | 2 +-
src/yolo_layer.h | 1 +
src/detector.c | 2 +-
5 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 986759f..9db41a8 100644
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,7 @@
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 0000000..2846301
--- /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.part) trainvalno5k.part | tr -d '\t' > trainvalno5k.txt
+
diff --git a/src/detector.c b/src/detector.c
index 25968e6..6d7689e 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -605,7 +605,7 @@
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 438829a..8c713fb 100644
--- a/src/network.c
+++ b/src/network.c
@@ -555,6 +555,9 @@
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 fb9712a..0c2f501 100644
--- a/src/yolo_layer.h
+++ b/src/yolo_layer.h
@@ -11,6 +11,7 @@
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);
--
Gitblit v1.10.0