Skip to content

We often use linear color transformation (like most implementations of contrast, brightness jitter). These transformations are potentially quickly learned by a neural network, especially networks with normalization layers. This repository implements non-linear color augmentations (like gamma-correction and the S-curves in Photoshop).

License

Notifications You must be signed in to change notification settings

hanspinckaers/nonlinear-color-aug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Non-linear color augmentations

We often use linear color transformation (like most implementations of contrast, brightness jitter). These transformations are potentially quickly learned by a neural network, especially networks with normalization layers. This repository implements non-linear color augmentations (like gamma-correction and the S-curves in Photoshop).

I cannot claim any benefits as I didn't perform any testing experiments yet.

RGB mapping curves

Randomly generated example curves showing how the RGB channels would get mapped to different values.

This repository is a PyTorch implementation of https://github.com/deepmind/multidim-image-augmentation

Example (see notebook)

Original

Example image

Image taken from the GlaS dataset.

Color augmentations:

Example augmented image

Usage

from coloraug import NonLinearColorJitter
transform = NonLinearColorJitter()
augmented_image = transform(image)

Or inside a torchvision.transform:

transforms.Compose([
        transforms.CenterCrop(10),
        NonLinearColorJitter(),
        transforms.ToTensor(),
    ])

About

We often use linear color transformation (like most implementations of contrast, brightness jitter). These transformations are potentially quickly learned by a neural network, especially networks with normalization layers. This repository implements non-linear color augmentations (like gamma-correction and the S-curves in Photoshop).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published