// 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);
}
// 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
// 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];
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_);