-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathmulti_image_data_layer.hpp
More file actions
48 lines (38 loc) · 1.34 KB
/
Copy pathmulti_image_data_layer.hpp
File metadata and controls
48 lines (38 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef CAFFE_MULTI_IMAGE_DATA_LAYER_HPP_
#define CAFFE_MULTI_IMAGE_DATA_LAYER_HPP_
#include <string>
#include <utility>
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/data_transformer.hpp"
#include "caffe/internal_thread.hpp"
#include "caffe/layer.hpp"
#include "caffe/layers/base_data_layer.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
/**
* @brief Provides data to the Net from image files.
*
* TODO(dox): thorough documentation for Forward and proto params.
*/
template <typename Dtype>
class MultiImageDataLayer : public BasePrefetchingDataLayer<Dtype> {
public:
explicit MultiImageDataLayer(const LayerParameter& param)
: BasePrefetchingDataLayer<Dtype>(param) {}
virtual ~MultiImageDataLayer();
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "MultiImageData"; }
virtual inline int ExactNumBottomBlobs() const { return 0; }
virtual inline int ExactNumTopBlobs() const { return 2; }
protected:
shared_ptr<Caffe::RNG> prefetch_rng_;
virtual void ShuffleImages();
virtual void load_batch(Batch<Dtype>* batch);
// vector<std::pair<std::string, int> > lines_;
vector<std::pair<vector<std::string>, int> > lines_;
int lines_id_;
};
} // namespace caffe
#endif // CAFFE_IMAGE_DATA_LAYER_HPP_