You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, shear_* and translate_* do wrap before transformation and unwrap after transformation. I am confused why we have to do these. Usually, when talking about shearing and translation, it is just a kind of affine transformation without doing these things.
I suppose that we previously implemented in that way is because our transform cannot select the extend mode/filling value. So we have to append an additional channel (wrap) before transformation, and check the zeros in that channel after transformation in order to replace the filling value to desired one (unwrap). Once #1721 gets merged, we could revamp the design/API.
The implementation of translate_xy is also confusing. Apart from wrap and unwrap, shouldn't translate_xy(x, [dx, dy]) is equivalent to translate(x, [dx, dy]) if replace is zero? So I think we can deprecate translate_xy after #1721 gets merged. Besides, translating [dx, 0] and then translating [0, dy] should be logically equivalent to translating [dx, dy] together unless there is some coordinate rounding issue when warping the image. https://github.com/tensorflow/addons/blob/master/tensorflow_addons/image/translate_ops.py#L124-L125
The text was updated successfully, but these errors were encountered:
Currently,
shear_*
andtranslate_*
dowrap
before transformation andunwrap
after transformation. I am confused why we have to do these. Usually, when talking about shearing and translation, it is just a kind of affine transformation without doing these things.I suppose that we previously implemented in that way is because our
transform
cannot select the extend mode/filling value. So we have to append an additional channel (wrap
) before transformation, and check the zeros in that channel after transformation in order to replace the filling value to desired one (unwrap
). Once #1721 gets merged, we could revamp the design/API.The implementation of translate_xy is also confusing. Apart from
wrap
andunwrap
, shouldn'ttranslate_xy(x, [dx, dy])
is equivalent totranslate(x, [dx, dy])
ifreplace
is zero? So I think we can deprecatetranslate_xy
after #1721 gets merged. Besides, translating[dx, 0]
and then translating[0, dy]
should be logically equivalent to translating[dx, dy]
together unless there is some coordinate rounding issue when warping the image.https://github.com/tensorflow/addons/blob/master/tensorflow_addons/image/translate_ops.py#L124-L125
The text was updated successfully, but these errors were encountered: