1

I am looking for a layer that randomly shears a batch of images, such as the preprocessing layers in tf.keras.layers.experimental.preprocessing. However, there doesn't seem to be any such layer.

There are a few similar questions to implementing shear layers in TF, but those use deprecated methods in tf.contrib (here and here). Can someone point me in a direction to implement random shears in tensorflow 2?

  • 1
    if I understood your question correctly, check out `tf.keras.preprocessing.image.ImageDataGenerator` – dm2 Aug 11 '20 at 00:15
  • That isn't quite what I'm looking for, I want to shear an image after I have already loaded it, I'm looking for a layer that shears – Andrew Wiedenmann Aug 11 '20 at 00:30

1 Answers1

1

Few of the operations of tf.contrib in Tensorflow 2.x is moved to Tensorflow addons. Equivalent for tf.contrib.image.transoform is tfa.image.transform For more details on library find here

And also take a look at Random_shear using tf.keras.preprocessing.image.random_shear