Posterization
类keras_cv.layers.Posterization(value_range, bits, **kwargs)
减少每个颜色通道的比特数。
参考文献
参数
value_range
内的值。默认为(0, 255)
。示例
(images, labels), _ = keras.datasets.cifar10.load_data()
print(images[0, 0, 0])
# [59 62 63]
# Note that images are Tensors with values in the range [0, 255] and uint8
dtype
posterization = Posterization(bits=4, value_range=[0, 255])
images = posterization(images)
print(images[0, 0, 0])
# [48., 48., 48.]
# NOTE: the layer will output values in tf.float32, regardless of input
dtype.
调用参数
"images"
键下。