initial commit
This commit is contained in:
commit
e505acdb29
41 changed files with 2922 additions and 0 deletions
50
caffe-layers/include/caffe/layers/dspp_layer.hpp
Normal file
50
caffe-layers/include/caffe/layers/dspp_layer.hpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef CAFFE_DSPP_LAYER_HPP_
|
||||
#define CAFFE_DSPP_LAYER_HPP_
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "caffe/blob.hpp"
|
||||
#include "caffe/common.hpp"
|
||||
#include "caffe/layers/data_layer.hpp"
|
||||
#include "caffe/layer.hpp"
|
||||
#include "caffe/layers/loss_layer.hpp"
|
||||
#include "caffe/layers/neuron_layer.hpp"
|
||||
#include "caffe/proto/caffe.pb.h"
|
||||
|
||||
namespace caffe {
|
||||
|
||||
template <typename Dtype>
|
||||
class DSPPLayer : public Layer<Dtype> {
|
||||
public:
|
||||
explicit DSPPLayer(const LayerParameter& param)
|
||||
: Layer<Dtype>(param) {}
|
||||
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
|
||||
const vector<Blob<Dtype>*>& top);
|
||||
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
|
||||
const vector<Blob<Dtype>*>& top);
|
||||
virtual inline const char* type() const { return "DSPPLayer"; }
|
||||
virtual inline int ExactNumBottomBlobs() const { return 2; };
|
||||
virtual inline int MinTopBlobs() const { return 1; }
|
||||
|
||||
protected:
|
||||
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
|
||||
const vector<Blob<Dtype>*>& top);
|
||||
//virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
|
||||
// const vector<Blob<Dtype>*>& top);
|
||||
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
|
||||
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
|
||||
//virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
|
||||
// const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
|
||||
|
||||
int width_;
|
||||
int height_;
|
||||
int channel_;
|
||||
int num_;
|
||||
|
||||
};
|
||||
|
||||
} // namespace caffe
|
||||
|
||||
#endif // CAFFE_DSPP_LAYER_HPP_
|
56
caffe-layers/include/caffe/layers/pose_data_layer.hpp
Normal file
56
caffe-layers/include/caffe/layers/pose_data_layer.hpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
#ifndef CAFFE_POSE_DATA_LAYER_HPP_
|
||||
#define CAFFE_POSE_DATA_LAYER_HPP_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "caffe/blob.hpp"
|
||||
#include "caffe/layer.hpp"
|
||||
#include "caffe/proto/caffe.pb.h"
|
||||
|
||||
#include "caffe/layers/base_data_layer.hpp"
|
||||
|
||||
namespace caffe {
|
||||
|
||||
template <typename Dtype>
|
||||
class PoseDataLayer : public BaseDataLayer<Dtype> {
|
||||
public:
|
||||
explicit PoseDataLayer(const LayerParameter& param)
|
||||
: BaseDataLayer<Dtype>(param), has_new_data_(false) {}
|
||||
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
|
||||
const vector<Blob<Dtype>*>& top);
|
||||
|
||||
virtual inline const char* type() const { return "PoseData"; }
|
||||
virtual inline int ExactNumBottomBlobs() const { return 0; }
|
||||
virtual inline int ExactNumTopBlobs() const { return 2; }
|
||||
|
||||
virtual void AddDatumVector(const vector<Datum>& datum_vector);
|
||||
virtual void AddMatVector(const vector<cv::Mat>& mat_vector,
|
||||
const vector<float>& labels);
|
||||
|
||||
// Reset should accept const pointers, but can't, because the memory
|
||||
// will be given to Blob, which is mutable
|
||||
void Reset(Dtype* data, Dtype* label, int n);
|
||||
void set_batch_size(int new_size);
|
||||
|
||||
int batch_size() { return batch_size_; }
|
||||
int channels() { return channels_; }
|
||||
int height() { return height_; }
|
||||
int width() { return width_; }
|
||||
|
||||
protected:
|
||||
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
|
||||
const vector<Blob<Dtype>*>& top);
|
||||
|
||||
int batch_size_, channels_, height_, width_, size_;
|
||||
Dtype* data_;
|
||||
Dtype* labels_;
|
||||
int n_;
|
||||
size_t pos_;
|
||||
Blob<Dtype> added_data_;
|
||||
Blob<Dtype> added_label_;
|
||||
bool has_new_data_;
|
||||
};
|
||||
|
||||
} // namespace caffe
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue