Solarization
類別keras.layers.Solarization(
addition_factor=0.0, threshold_factor=0.0, value_range=(0, 255), seed=None, **kwargs
)
對圖像中的每個像素應用 (max_value - pixel + min_value)
。
當創建時沒有 threshold
參數,此層會對所有值執行日光化。當使用指定的 threshold
創建時,此層僅增強高於 threshold
值的像素。
參數
(0, addition_factor)
。如果指定,則此值(乘以輸入圖像的值範圍,例如 255)會在日光化和閾值處理之前添加到每個像素。預設值為 0.0。(0, threshold_factor)
。如果指定,則只有高於此閾值的像素值會被日光化。value_range
範圍內的值。典型的傳遞值為 (0, 255)
(RGB 圖像) 或 (0., 1.)
(縮放圖像)。name
和 dtype
。範例
(images, labels), _ = keras.datasets.cifar10.load_data()
print(images[0, 0, 0])
# [59 62 63]
# Note that images are Tensor with values in the range [0, 255]
solarization = Solarization(value_range=(0, 255))
images = solarization(images)
print(images[0, 0, 0])
# [196, 193, 192]