This data augmentation tool adds brightness, contrast, saturation, and hue to your sample images.
It sets the brightness of the transformed image.
In visual perception, contrast refers to the difference of color and brightness of objects in the same field of view.
Color saturation refers to the intensity and the purity of a color as displayed in the image. If the image is highly saturated then the colors are more intense and vivid.
Hue is one of the main indication of the appearance of the color itself. It refers to the attribute of the visible light due to which it is differentiated from or similar to primary colors: red, green, and blue. Usually, colors with the same hue are distinguished with adjectives referring to their lightness or colorfulness, such as with "light blue", "pastel blue", etc.
The augmentation randomly picks a different "shift" to change the hue of the sample images.
import albumentations as albu
from PIL import Image
import numpy as np
transform =albu.ColorJitter(brightness=0.2, contrast=0.2, saturation=0.2, hue=0.2, p=0.5)
image = np.array(Image.open('/some/image/file/path'))
image = transform(image=image)['image']
# Now the image is transformed and ready to be accepted by the model
Only 13% of vision AI projects make it to production, with Hasty we boost that number to 100%.