From f199fd3b6464e644566d76676c0b5f1824d26c4e Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 17 Apr 2015 19:32:54 +0000
Subject: [PATCH] per image randomness in crop layer

---
 src/crop_layer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/crop_layer.c b/src/crop_layer.c
index e83aea2..7ae4aa5 100644
--- a/src/crop_layer.c
+++ b/src/crop_layer.c
@@ -10,7 +10,7 @@
     return float_to_image(w,h,c,layer.output);
 }
 
-crop_layer *make_crop_layer(int batch, int h, int w, int c, int crop_height, int crop_width, int flip, float angle)
+crop_layer *make_crop_layer(int batch, int h, int w, int c, int crop_height, int crop_width, int flip, float angle, float saturation, float exposure)
 {
     fprintf(stderr, "Crop Layer: %d x %d -> %d x %d x %d image\n", h,w,crop_height,crop_width,c);
     crop_layer *layer = calloc(1, sizeof(crop_layer));
@@ -20,11 +20,14 @@
     layer->c = c;
     layer->flip = flip;
     layer->angle = angle;
+    layer->saturation = saturation;
+    layer->exposure = exposure;
     layer->crop_width = crop_width;
     layer->crop_height = crop_height;
     layer->output = calloc(crop_width*crop_height * c*batch, sizeof(float));
     #ifdef GPU
     layer->output_gpu = cuda_make_array(layer->output, crop_width*crop_height*c*batch);
+    layer->rand_gpu = cuda_make_array(0, layer->batch*8);
     #endif
     return layer;
 }

--
Gitblit v1.10.0