From 1e512b23089b23e91fa5ed6a617641d9286d1417 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 04 Jun 2018 19:11:05 +0000
Subject: [PATCH] Letter box is disabled in the darknet.py by defualt

---
 src/network.c                |    3 ++-
 build/darknet/x64/darknet.py |    2 +-
 darknet.py                   |    2 +-
 src/image.h                  |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/build/darknet/x64/darknet.py b/build/darknet/x64/darknet.py
index 75ef04b..dff0a31 100644
--- a/build/darknet/x64/darknet.py
+++ b/build/darknet/x64/darknet.py
@@ -235,7 +235,7 @@
     if debug: print("Assigned pnum")
     predict_image(net, im)
     if debug: print("did prediction")
-    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum, 1)
+    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum, 0)
     if debug: print("Got dets")
     num = pnum[0]
     if debug: print("got zeroth index of pnum")
diff --git a/darknet.py b/darknet.py
index 75ef04b..dff0a31 100644
--- a/darknet.py
+++ b/darknet.py
@@ -235,7 +235,7 @@
     if debug: print("Assigned pnum")
     predict_image(net, im)
     if debug: print("did prediction")
-    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum, 1)
+    dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum, 0)
     if debug: print("Got dets")
     num = pnum[0]
     if debug: print("got zeroth index of pnum")
diff --git a/src/image.h b/src/image.h
index d047f62..84b1224 100644
--- a/src/image.h
+++ b/src/image.h
@@ -30,7 +30,7 @@
 image random_crop_image(image im, int w, int h);
 image random_augment_image(image im, float angle, float aspect, int low, int high, int size);
 void random_distort_image(image im, float hue, float saturation, float exposure);
-image resize_image(image im, int w, int h);
+YOLODLL_API image resize_image(image im, int w, int h);
 void fill_image(image m, float s);
 void letterbox_image_into(image im, int w, int h, image boxed);
 YOLODLL_API image letterbox_image(image im, int w, int h);
diff --git a/src/network.c b/src/network.c
index 050d334..1498a2a 100644
--- a/src/network.c
+++ b/src/network.c
@@ -640,7 +640,8 @@
 
 float *network_predict_image(network *net, image im)
 {
-	image imr = letterbox_image(im, net->w, net->h);
+	//image imr = letterbox_image(im, net->w, net->h);
+	image imr = resize_image(im, net->w, net->h);
 	set_batch_network(net, 1);
 	float *p = network_predict(*net, imr.data);
 	free_image(imr);

--
Gitblit v1.10.0