From 729ce43e6ec45cfdb58e06e227428a0f81c5de0f Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 10 Jun 2016 00:20:31 +0000
Subject: [PATCH] stuff
---
src/classifier.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/classifier.c b/src/classifier.c
index 5104608..24b28b5 100644
--- a/src/classifier.c
+++ b/src/classifier.c
@@ -477,6 +477,7 @@
int *indexes = calloc(top, sizeof(int));
char buff[256];
char *input = buff;
+ int size = net.w;
while(1){
if(filename){
strncpy(input, filename, 256);
@@ -487,8 +488,12 @@
if(!input) return;
strtok(input, "\n");
}
- image im = load_image_color(input, net.w, net.h);
- float *X = im.data;
+ image im = load_image_color(input, 0, 0);
+ image r = resize_min(im, size);
+ resize_network(&net, r.w, r.h);
+ printf("%d %d\n", r.w, r.h);
+
+ float *X = r.data;
time=clock();
float *predictions = network_predict(net, X);
top_predictions(net, top, indexes);
@@ -497,6 +502,7 @@
int index = indexes[i];
printf("%s: %f\n", names[index], predictions[index]);
}
+ if(r.data != im.data) free_image(r);
free_image(im);
if (filename) break;
}
--
Gitblit v1.10.0