Skip to content

Conversation

sizhky
Copy link

@sizhky sizhky commented Oct 1, 2019

Tasks like OCR need shear in x direction only.
This pull request adds an ability to add shear only in x, or y or both directions while creating pipeline.shear

E.g.

p = Augmentor.DataPipeline(ims, labels)
p.shear(probability=1, max_shear_left=10, max_shear_right=10, direction=['x'])

@mdbloice
Copy link
Owner

Hi @sizhky, first of all, sorry for the late reply. Yes, this is a good idea. Let's add it but I would suggest we first make the user-facing option in Pipeline.py a little bit more friendly than directions=['x', 'y']. How about the direction can be either random, left, or right. Also, let's then change the parameter name to direction in this case. The signature would then be:

def __init__(self, probability, max_shear_left, max_shear_right, direction='random')

So it defaults to random, but you can specify left or right. We then need to change the code slightly in Operations.py to use these three possible parameters and adjust x and y accordingly there.

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