简体   繁体   中英

How can I implement a random shear preprocessing layer in tensorflow 2?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM