mlpack / models

models built with mlpack
https://models.mlpack.org/docs
BSD 3-Clause "New" or "Revised" License
35 stars 40 forks source link

added horizontal and vertical flip augmentations #38

Open RituRajSingh878 opened 4 years ago

RituRajSingh878 commented 4 years ago

Related to #21 I am adding horizontal-flip and vertical-flip augmentations in augmentation. I am opening this as a draft pr because many things are not clear to me and have to discuss it. After that, I will modify it.

mlpack-bot[bot] commented 4 years ago

Thanks for opening your first pull request in this repository! Someone will review it when they have a chance. In the mean time, please be sure that you've handled the following things, to make the review process quicker and easier:

Thank you again for your contributions! :+1:

kartikdutt18 commented 4 years ago

Hmm, I don't think we need horizontal-flip:true or false. If user wants it he will add to the string else he won't.

RituRajSingh878 commented 4 years ago

Hmm, I don't think we need horizontal-flip:true or false. If user wants it he will add to the string else he won't.

Okay, I will the change code in the next commit.

RituRajSingh878 commented 3 years ago

  for(size_t i = 0; i < augmentations.size(); i++)
  {
    if( augmentations[i] == "horizontal-flip")
    augmentationMap[augmentations[i]] = &Augmentation::HorizontalFlipTransform;
  }

I am doing smothing like this and getting the following error. I am not sure how should I use add it and where should I add it? I guess, I am doing something wrong and don't know how to use it properly. So if you can explain and suggest something.

home/rituraj/models/tests/augmentation_tests.cpp:32:63:   required from here
/home/rituraj/models/tests/../augmentation/augmentation_impl.hpp:32:39: error: no matches converting function ‘HorizontalFlipTransform’ to type ‘std::unordered_map<std::__cxx11::basic_string<char>, void (*)(arma::Mat<double>&, long unsigned int, long unsigned int, long unsigned int, std::__cxx11::basic_string<char>&), std::hash<std::__cxx11::basic_string<char> >, std::equal_to<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, void (*)(arma::Mat<double>&, long unsigned int, long unsigned int, long unsigned int, std::__cxx11::basic_string<char>&)> > >::mapped_type {aka void (*)(class arma::Mat<double>&, long unsigned int, long unsigned int, long unsigned int, class std::__cxx11::basic_string<char>&)}’
     augmentationMap[augmentations[i]] = &Augmentation::HorizontalFlipTransform;
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /home/rituraj/models/tests/augmentation_tests.cpp:14:0:
/home/rituraj/models/tests/../augmentation/augmentation.hpp:124:8: note: candidate is: template<class DatasetType> void Augmentation::HorizontalFlipTransform(DatasetType&, size_t, size_t, size_t, const string&)
   void HorizontalFlipTransform(DatasetType& dataset,
        ^~~~~~~~~~~~~~~~~~~~~~~
tests/CMakeFiles/models_test.dir/build.make:62: recipe for target 'tests/CMakeFiles/models_test.dir/augmentation_tests.cpp.o' failed
make[2]: *** [tests/CMakeFiles/models_test.dir/augmentation_tests.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mlpack-bot[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! :+1:

mlpack-bot[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! :+1: