クラスのメソッドに必要なself
が抜けているのでは?
import imgaug.augmenters as iaa
class AugLayer(tf.keras.layers.Layer):
def __init__(self, n, m):
super().__init__()
self.augment = iaa.RandAugment(n, m)
- def call(image, **kwargs):
+ def call(self, image, **kwargs):
image = tf.cast(image, tf.uint8)
image = self.augment(image.numpy())
image = tf.cast(image, tf.float32)
return image
1Like