From 0d6b107ed20c22412ccf3a5056cffdb35bc25534 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 16 Nov 2016 06:53:58 +0000
Subject: [PATCH] hey

---
 src/reorg_layer.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/reorg_layer.c b/src/reorg_layer.c
index 0f2a1c2..d93dd97 100644
--- a/src/reorg_layer.c
+++ b/src/reorg_layer.c
@@ -22,6 +22,7 @@
         l.out_h = h/stride;
         l.out_c = c*(stride*stride);
     }
+    l.reverse = reverse;
     fprintf(stderr, "Reorg Layer: %d x %d x %d image -> %d x %d x %d image, \n", w,h,c,l.out_w, l.out_h, l.out_c);
     l.outputs = l.out_h * l.out_w * l.out_c;
     l.inputs = h*w*c;
@@ -44,12 +45,20 @@
 void resize_reorg_layer(layer *l, int w, int h)
 {
     int stride = l->stride;
+    int c = l->c;
 
     l->h = h;
     l->w = w;
 
-    l->out_w = w*stride;
-    l->out_h = h*stride;
+    if(l->reverse){
+        l->out_w = w*stride;
+        l->out_h = h*stride;
+        l->out_c = c/(stride*stride);
+    }else{
+        l->out_w = w/stride;
+        l->out_h = h/stride;
+        l->out_c = c*(stride*stride);
+    }
 
     l->outputs = l->out_h * l->out_w * l->out_c;
     l->inputs = l->outputs;

--
Gitblit v1.10.0