From 028696bf15efeca3acb3db8c42a96f7b9e0f55ff Mon Sep 17 00:00:00 2001
From: iovodov <b@ovdv.ru>
Date: Thu, 03 May 2018 13:33:46 +0000
Subject: [PATCH] Output improvements for detector results: When printing detector results, output was done in random order, obfuscating results for interpreting. Now: 1. Text output includes coordinates of rects in (left,right,top,bottom in pixels) along with label and score 2. Text output is sorted by rect lefts to simplify finding appropriate rects on image 3. If several class probs are > thresh for some detection, the most probable is written first and coordinates for others are not repeated 4. Rects are imprinted in image in order by their best class prob, so most probable rects are always on top and not overlayed by less probable ones 5. Most probable label for rect is always written first Also: 6. Message about low GPU memory include required amount
---
src/dice.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/dice.c b/src/dice.c
index 7948741..2286459 100644
--- a/src/dice.c
+++ b/src/dice.c
@@ -6,7 +6,6 @@
void train_dice(char *cfgfile, char *weightfile)
{
- data_seed = time(0);
srand(time(0));
float avg_loss = -1;
char *base = basecfg(cfgfile);
@@ -27,7 +26,7 @@
while(1){
++i;
time=clock();
- data train = load_data(paths, imgs, plist->size, labels, 6, net.w, net.h);
+ data train = load_data_old(paths, imgs, plist->size, labels, 6, net.w, net.h);
printf("Loaded: %lf seconds\n", sec(clock()-time));
time=clock();
@@ -60,8 +59,8 @@
int m = plist->size;
free_list(plist);
- data val = load_data(paths, m, 0, labels, 6, net.w, net.h);
- float *acc = network_accuracies(net, val);
+ data val = load_data_old(paths, m, 0, labels, 6, net.w, net.h);
+ float *acc = network_accuracies(net, val, 2);
printf("Validation Accuracy: %f, %d images\n", acc[0], m);
free_data(val);
}
@@ -76,7 +75,8 @@
srand(2222222);
int i = 0;
char **names = dice_labels;
- char input[256];
+ char buff[256];
+ char *input = buff;
int indexes[6];
while(1){
if(filename){
@@ -84,7 +84,8 @@
}else{
printf("Enter Image Path: ");
fflush(stdout);
- fgets(input, 256, stdin);
+ input = fgets(input, 256, stdin);
+ if(!input) return;
strtok(input, "\n");
}
image im = load_image_color(input, net.w, net.h);
--
Gitblit v1.10.0