Skip to content

Use ImageNet mean and std values

Mélodie Boillet requested to merge use-default-mean-std into main

Closes #111 (closed) #114 (closed) #102 (closed)

Needs !171 (merged)

In this MR:

  • We use ImageNet's normalization parameters (which give the same results as those calculated on the training set). This saves time before training, as we no longer iterate over all the training data to calculate these parameters, while maintaining similar performance (#111 (closed))
  • Thanks to this modification, we can use torchvision's normalization function, but it takes a tensor of size CxHxW as input, so we load the data directly using the torch.read_image function (#102 (closed))
  • The pre-processing transformations are now done on tensors (and not on PIL images), so codes have been updated
  • The data pre-processing is done directly after loading images, to reduce memory requirements with the load_in_memory parameters
  • Update of the documentation and tests
Edited by Mélodie Boillet

Merge request reports

Loading