Fixed typos to pass test_images_layer
authorsguada <sguada@gmail.com>
Mon, 17 Feb 2014 18:18:26 +0000 (10:18 -0800)
committersguada <sguada@gmail.com>
Mon, 17 Feb 2014 18:32:37 +0000 (10:32 -0800)
include/caffe/vision_layers.hpp
src/caffe/layers/images_layer.cpp
src/caffe/proto/caffe.proto
src/caffe/test/test_images_layer.cpp

index 51d3a36..ee79bbc 100644 (file)
@@ -341,17 +341,17 @@ class DataLayer : public Layer<Dtype> {
 
 // This function is used to create a pthread that prefetches the data.
 template <typename Dtype>
-void* InputLayerPrefetch(void* layer_pointer);
+void* ImagesLayerPrefetch(void* layer_pointer);
 
 template <typename Dtype>
-class InputLayer : public Layer<Dtype> {
+class ImagesLayer : public Layer<Dtype> {
   // The function used to perform prefetching.
- friend void* InputLayerPrefetch<Dtype>(void* layer_pointer);
+ friend void* ImagesLayerPrefetch<Dtype>(void* layer_pointer);
 
  public:
-  explicit InputLayer(const LayerParameter& param)
+  explicit ImagesLayer(const LayerParameter& param)
       : Layer<Dtype>(param) {}
-  virtual ~InputLayer();
+  virtual ~ImagesLayer();
   virtual void SetUp(const vector<Blob<Dtype>*>& bottom,
       vector<Blob<Dtype>*>* top);
 
index f600dbc..75ed643 100644 (file)
@@ -162,8 +162,8 @@ void ImagesLayer<Dtype>::SetUp(const vector<Blob<Dtype>*>& bottom,
   }
   // Read a data point, and use it to initialize the top blob.
   Datum datum;
-  const int new_height  = layer->layer_param_.new_height();
-  const int new_width  = layer->layer_param_.new_height();
+  const int new_height  = this->layer_param_.new_height();
+  const int new_width  = this->layer_param_.new_height();
   CHECK(ReadImageToDatum(lines_[lines_id_].first, lines_[lines_id_].second,
                          new_height,new_width,&datum));
   // image
index d9a5524..183cf62 100644 (file)
@@ -92,6 +92,12 @@ message LayerParameter {
   // be larger than the number of keys in the leveldb.
   optional uint32 rand_skip = 53 [ default = 0 ];
 
+  // For the Reshape Layer one need to specify the new dimensions
+  optional int32 new_num = 60 [default = 0];
+  optional int32 new_channels = 61 [default = 0];
+  optional int32 new_height = 62 [default = 0];
+  optional int32 new_width = 63 [default = 0];
+
   // Used by ImageLayer to shuffle the list of files at every epoch it will also
   // resize images if new_height or new_width are not zero
   optional bool shuffle_images = 64 [default = false];
index f98df37..af5f81d 100644 (file)
@@ -80,7 +80,8 @@ TYPED_TEST(ImagesLayerTest, TestResize) {
   LayerParameter param;
   param.set_batchsize(5);
   param.set_source(this->filename);
-  param.set_resize_image(256);
+  param.set_new_height(256);
+  param.set_new_width(256);
   param.set_shuffle_images(false);
   ImagesLayer<TypeParam> layer(param);
   layer.SetUp(this->blob_bottom_vec_, &this->blob_top_vec_);