Skip to content

Commit

Permalink
Augmentation work
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikdutt18 committed May 31, 2020
1 parent 73b2898 commit cca7a1b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
6 changes: 2 additions & 4 deletions augmentation/augmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ class Augmentation
* the dataset.
* NOTE : This doesn't apply to augmentations
* such as resize.
* @param batches Boolean to determine if input is a single data point or
* a batch. Defaults to true.
* NOTE : If true, each data point must be represented as a
* seperate column.
*/
Augmentation(const std::vector<std::string>& augmentation,
const double augmentationProbability);
Expand Down Expand Up @@ -127,4 +123,6 @@ class Augmentation
double augmentationProbability;
};

#include "augmentation_impl.hpp" // Include implementation.

#endif
24 changes: 24 additions & 0 deletions augmentation/augmentation_impl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @file augmentation_impl.hpp
* @author Kartik Dutt
*
* Implementation of Augmentation class for augmenting data.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-clause BSD license along with mlpack. If not, see
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
*/
// Incase it has not been included already.
#include "augmentation.hpp"

#ifndef MODELS_AUGMENTATION_IMPL_HPP
#define MODELS_AUGMENTATION_IMPL_HPP

Augmentation::Augmentation() :
augmentations(std::vector<std::string>()),
augmentationProbability(0.2)
{
// Nothing to do here.
}
#endif
4 changes: 4 additions & 0 deletions dataloader/dataloader_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ template<
size_t imageDepth = std::stoi(sizeInformation.get_child("depth").data());
mlpack::data::ImageInfo imageInfo(imageWidth, imageHeight, imageDepth);

// TODO: Resize the image here.

// Load the image.
// The image loaded here will be in column format i.e. Output will be matrix with the
// following shape {1, cols * rows * slices} in column major format.
Expand Down Expand Up @@ -250,6 +252,8 @@ template<
}
}
}

// TODO: Augment the image here.
}
}

Expand Down

0 comments on commit cca7a1b

Please sign in to comment.