AlexeyAB
2018-04-11 4d9a2bdac688f9c949b304dde8188a40efce1b49
Minor fixes
4 files modified
1 files added
39 ■■■■■ changed files
Makefile 2 ●●● patch | view | raw | blame | history
scripts/get_coco_dataset.sh 31 ●●●●● patch | view | raw | blame | history
src/detector.c 2 ●●● patch | view | raw | blame | history
src/network.c 3 ●●●●● patch | view | raw | blame | history
src/yolo_layer.h 1 ●●●● patch | view | raw | blame | history
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
scripts/get_coco_dataset.sh
New file
@@ -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
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];
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)
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);