Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow full crop #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Allow full crop #79

wants to merge 2 commits into from

Conversation

rctzeng
Copy link

@rctzeng rctzeng commented Feb 28, 2018

Hi, I just found Augmentor. It is a great tool!
So, I extended a little bit to allow for a common operator - the full crop(i.e. cropping into size larger than the original size).
I hope this fix would be useful for other users, too.

@mdbloice
Copy link
Owner

Hi @Lubebul
thanks for the PR, that's something I wanted to add, however right now as it is we'd need to alter it a bit because within the do(image) function, there cannot be any randomness (this is for the ground truth, multi-image augmentation stuff, so that any images passed in pairs through the perform_operation() function are returned with the same alterations.

So the

left_shift = sign_w * random.randint(0, int(sign_w * diff_w))
down_shift = sign_h * random.randint(0, int(sign_h * diff_h))

stuff would need to be moved outside of do() somehow. I can do that myself, or do you wanna do that yourself and change your PR?
M.

@rctzeng
Copy link
Author

rctzeng commented Feb 28, 2018

@mdbloice, thanks for the comment.
I've moved the random shift from do() to perform_operation() following the approach in class CropPercentage.

@mdbloice
Copy link
Owner

mdbloice commented Mar 5, 2018

@Lubebul, great thanks I will look at the code again and merge it as soon as I'm done taking a look.

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