A slightly modified version of the above code
This suppose a defined mean and std.
inv_normalize = transforms.Normalize(
mean= [-m/s for m, s in zip(mean, std)],
std= [1/s for s in std]
)
inv_tensor = inv_normalize(tensor)
A slightly modified version of the above code
This suppose a defined mean and std.
inv_normalize = transforms.Normalize(
mean= [-m/s for m, s in zip(mean, std)],
std= [1/s for s in std]
)
inv_tensor = inv_normalize(tensor)