Closed sup3rgiu closed 10 months ago
@sup3rgiu thank you for filing the issue! If you can open a PR for vectorized implementation of these layers with example outputs showing different augmentations for each image in a batch. that would be great!
@sup3rgiu thank you for filing the issue! If you can open a PR for vectorized implementation of these layers with example outputs showing different augmentations for each image in a batch. that would be great!
Current Behavior:
As Keras_CV==0.6.4, RandomColorDegeneration and Equalization preprocessing layers are not subclasses of
VectorizedBaseImageAugmentationLayer
, thus resulting in a slow forward pass.Expected Behavior:
RandomColorDegeneration and Equalization preprocessing layers should be subclasses of
VectorizedBaseImageAugmentationLayer
(introduced in v. 0.5.0). The implementation ofRandomColorDegeneration
is quite straightforward, whileRandomColorDegeneration
has a potential bottleneck represented by tf.histogram_fixed_width. In the following Colab I propose an implementation for both layers.Colab:
This colab includes a possible vectorized implementation of the given layers, and also a benchmark. https://colab.research.google.com/drive/1t5b4a11ae3HWxUoyL-R50E2z8dkNSQYP?usp=sharing
Version:
0.6.4