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"
鍵下。