Hello everybody!
I’m using Chars74K dataset to train a model for recognize text in the wild. I would like to make some test with different model, transformations, hyperparameters and compare the results.
I would like to:

Binarize the image (black or white pixels) with a threshold on each image on train loader
Apply a mask (Chars74K provide a mask for each image to cut only the number/letter in the image)

This is how I load image form folder
import torch
import torchvision
import numpy as np
import matplotlib.pyplot as plt

from torchvision import transforms, datasets

data_transform = transforms.Compose([
        transforms.Resize((64,64)),
        transforms.Grayscale(),
        transforms.ToTensor(),
        transforms.Normalize(mean=[0.5, 0.5, 0.5],
                             std=[0.225, 0.225, 0.225])
    ])
chars74k_dataset = datasets.ImageFolder(root='English/Img/GoodImg/Bmp',
                                           transform=data_transform)
dataset_loader = torch.utils.data.DataLoader(chars74k_dataset,
                                             batch_size=1, shuffle=True,
                                             num_workers=4)

Thank you for your help
Matteo