Closed LukeWood closed 2 years ago
This will require rewriting from numpy to TensorFlow
This will require rewriting from numpy to TensorFlow
I have been using this implementation. Maybe it can help: https://github.com/tensorflow/models/blob/ded32f0500604928e52e27fd3f678e694e5133b7/official/vision/image_classification/augment.py#L905
A batched implementation exists in imgaug:
A batched implementation exists in imgaug:
But it Is not the best solution as it needs to be tf.py_function
wrapped as It handles Numpy arrays not Tensor.
I'll be contributing this shortly
If it could be to any inspiration, I also have a keras layer implementation of RandAug in my own toolbox: https://github.com/chjort/chambers/tree/master/chambers/augmentations specifically at this line.
It is based on https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/autoaugment.py, but my implementation includes vectorized/batched implementations of all transforms, although some of the layers make use of tensorflow-addons.
Thanks for the links! I’ll let you know if I used them. I’ll likely base mine on tensorflow similarity’s
https://keras.io/examples/vision/randaugment/