My problem is fairly simple but I’m not sure if I’m doing it correctly. I will state what I’m doing so far and wish that someone will tell me if I’m mistaken or if I’m doing it correctly as I have not found a solution online.
I have coded an algorithm to make the “Shades of Gray” normalization of an image. I want this algorithm to be run on every image of my dataset. In order to do this I create a transforms.Compose. A snippet of the code would look like this:
import torchvision import transforms
from color_constancy import shades_of_gray

transform = transforms.Compose([
                               shades_of_gray(),
                               transforms.RandomVerticalFlip(),
                               transforms.RandomHorizontalFlip(),
                               transforms.ToTensor()
                              ])

dataset = torchvision.dataset.ImageFolder(train_path, transform=transform)

The module “color_constancy” is a self made script. The shades_of_grays method only accepts one image at a time but I suppose that the transform is done image-wise (again, correct me if I’m wrong) After this I just take the dataset into a dataloader and continue with the standard procedures.
Thanks for any advice,
Best regards.
Am