Skip to content

Conversation

@scott-zockoll
Copy link

Instead of just being able to use all of the original images (n=0), this allows cloning the original images (by using a negative number) before applying the transformations.

This is my first time asking for a pull request on GitHub. This is a very small change. When I was using this package in my project I wanted a way to scale my original dataset, but also keep the data even over all the categories. In sample(), you specify the number of samples you would like to generate (the n parameter), but this is stochastic and does not keep the categories even. You can also use n=0 apply transformations on every image in the original dataset, but I wanted multiple transformations on the same image (say I was scaling my dataset 3x). I added a couple lines for the ability to specify negative numbers for n. The absolute value of n is the amount you wish to scale the dataset before applying the transformations.

Again this is my first pull request, please let me know what I did wrong.

Instead of just being able to use all of the original images (n=0), this allows cloning the original images (by using a negative number) before applying the transformations.
@mdbloice
Copy link
Owner

Hi @scott-zockoll that is not a bad idea, and actually that exact feature was actually default behaviour in a previous version of Augmentor, as the images were not randomised (basically it would iterate over all images repeatedly until n samples were generated). If I remember correctly a few people complained about that, and didn't like this behaviour so I changed it to be random. I think having the option to not do this randomly makes sense, and one could provide a scale parameter instead of a n value. I think it would be best if we made a new function for this rather than making the sample() any way ambiguous. Perhaps instead we should decide on a good name for this feature, perhaps something like scale(factor) or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants