mednet.models.normalizer¶
Functions to compute normalisation factors based on dataloaders.
Functions
Return the stock COCO v1 normalisation weights from torchvision. |
|
Return the stock ImageNet normalisation weights from torchvision. |
|
|
Compute mean and standard deviation from a dataloader. |
- mednet.models.normalizer.make_z_normalizer(dataloader)[source]¶
Compute mean and standard deviation from a dataloader.
This function will input a dataloader, and compute the mean and standard deviation by image channel. It will work for both monochromatic, and color inputs with 2, 3 or more color planes.
- Parameters:
dataloader (
DataLoader
) – A torch Dataloader from which to compute the mean and std.- Return type:
- Returns:
An initialized normalizer.