summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Donahue <jeff.donahue@gmail.com>2015-05-29 21:35:30 -0700
committerJeff Donahue <jeff.donahue@gmail.com>2015-05-29 21:35:30 -0700
commit8b05a021881cb1c882f9b8ff7331ddd188126c23 (patch)
treea7a6dc98d86cbaab16b2a48b0521b74f302ed986 /include
parent7e981456c1d4092fdb02bac922207a4c2dcd0521 (diff)
parente048b1741e8a5dfafeecff96c5a69d3211224fd6 (diff)
downloadcaffeonacl-8b05a021881cb1c882f9b8ff7331ddd188126c23.tar.gz
caffeonacl-8b05a021881cb1c882f9b8ff7331ddd188126c23.tar.bz2
caffeonacl-8b05a021881cb1c882f9b8ff7331ddd188126c23.zip
Merge pull request #2410 from sguada/datum_transform
Datum transform
Diffstat (limited to 'include')
-rw-r--r--include/caffe/data_transformer.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/caffe/data_transformer.hpp b/include/caffe/data_transformer.hpp
index 88035660..0ad68c80 100644
--- a/include/caffe/data_transformer.hpp
+++ b/include/caffe/data_transformer.hpp
@@ -62,6 +62,7 @@ class DataTransformer {
*/
void Transform(const vector<cv::Mat> & mat_vector,
Blob<Dtype>* transformed_blob);
+
/**
* @brief Applies the transformation defined in the data layer's
* transform_param block to a cv::Mat
@@ -87,6 +88,41 @@ class DataTransformer {
*/
void Transform(Blob<Dtype>* input_blob, Blob<Dtype>* transformed_blob);
+ /**
+ * @brief Infers the shape of transformed_blob will have when
+ * the transformation is applied to the data.
+ *
+ * @param datum
+ * Datum containing the data to be transformed.
+ */
+ vector<int> InferBlobShape(const Datum& datum);
+ /**
+ * @brief Infers the shape of transformed_blob will have when
+ * the transformation is applied to the data.
+ * It uses the first element to infer the shape of the blob.
+ *
+ * @param datum_vector
+ * A vector of Datum containing the data to be transformed.
+ */
+ vector<int> InferBlobShape(const vector<Datum> & datum_vector);
+ /**
+ * @brief Infers the shape of transformed_blob will have when
+ * the transformation is applied to the data.
+ * It uses the first element to infer the shape of the blob.
+ *
+ * @param mat_vector
+ * A vector of Mat containing the data to be transformed.
+ */
+ vector<int> InferBlobShape(const vector<cv::Mat> & mat_vector);
+ /**
+ * @brief Infers the shape of transformed_blob will have when
+ * the transformation is applied to the data.
+ *
+ * @param cv_img
+ * cv::Mat containing the data to be transformed.
+ */
+ vector<int> InferBlobShape(const cv::Mat& cv_img);
+
protected:
/**
* @brief Generates a random integer from Uniform({0, 1, ..., n-1}).