From 47528e37cf29e0f9da6885213e5aee044bed84ef Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 15 Apr 2015 08:04:38 +0000
Subject: [PATCH] crop layer scaling and trans on cpu

---
 src/parser.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/parser.c b/src/parser.c
index d7c4a31..08e0ea1 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -165,7 +165,9 @@
     int coords = option_find_int(options, "coords", 1);
     int classes = option_find_int(options, "classes", 1);
     int rescore = option_find_int(options, "rescore", 1);
-    detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore);
+    int nuisance = option_find_int(options, "nuisance", 0);
+    int background = option_find_int(options, "background", 1);
+    detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore, background, nuisance);
     option_unused(options);
     return layer;
 }
@@ -184,6 +186,7 @@
     int crop_height = option_find_int(options, "crop_height",1);
     int crop_width = option_find_int(options, "crop_width",1);
     int flip = option_find_int(options, "flip",0);
+    float angle = option_find_float(options, "angle",0);
 
     int batch,h,w,c;
     h = params.h;
@@ -192,7 +195,7 @@
     batch=params.batch;
     if(!(h && w && c)) error("Layer before crop layer must output image.");
 
-    crop_layer *layer = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip);
+    crop_layer *layer = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip, angle);
     option_unused(options);
     return layer;
 }
@@ -248,12 +251,16 @@
     net->momentum = option_find_float(options, "momentum", .9);
     net->decay = option_find_float(options, "decay", .0001);
     net->seen = option_find_int(options, "seen",0);
+    int subdivs = option_find_int(options, "subdivisions",1);
+    net->batch /= subdivs;
+    net->subdivisions = subdivs;
 
     net->h = option_find_int_quiet(options, "height",0);
     net->w = option_find_int_quiet(options, "width",0);
     net->c = option_find_int_quiet(options, "channels",0);
     net->inputs = option_find_int_quiet(options, "inputs", net->h * net->w * net->c);
     if(!net->inputs && !(net->h && net->w && net->c)) error("No input parameters supplied");
+    option_unused(options);
 }
 
 network parse_network_cfg(char *filename)
@@ -545,7 +552,7 @@
 void print_detection_cfg(FILE *fp, detection_layer *l, network net, int count)
 {
     fprintf(fp, "[detection]\n");
-    fprintf(fp, "classes=%d\ncoords=%d\nrescore=%d\n", l->classes, l->coords, l->rescore);
+    fprintf(fp, "classes=%d\ncoords=%d\nrescore=%d\nnuisance=%d\n", l->classes, l->coords, l->rescore, l->nuisance);
     fprintf(fp, "\n");
 }
 

--
Gitblit v1.10.0