Normalizing pixel values #1569
Unanswered
roybenhayun
asked this question in
Q&A
Replies: 1 comment
-
Yes, you almost always want normalization.
This is up to the user. Popular choices include mapping to the 0–1 range or subtracting the mean and dividing by the standard deviation. I would personally recommend using Kornia to apply normalization to an entire batch of data at a time instead of passing a transform to the dataset. This is what we do in our data modules.
See #1263 for a proposal of a better way to handle this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
in many cases, normalizing input data to a range between 0 and 1 can improve the performance of neural networks.
how and what typically would be a good normalization of images and masks in torchgeo?
for example, when using Sentinel2, the pixels values are 0-10000 (i.e, see how Sentinel2.plot() "normalizes" and clamps the values for local rendering purpose).
so should a transform, which does a similar normalization, be passed to the Sentinel2 dataset c'tor?
s2_ds = Sentinel2(root=sn2_root, bands=Sentinel2.rgb_bands, transforms=preprocess)
however, this will break the Sentinel2.plot()...
so the questions are:
thanks!
Beta Was this translation helpful? Give feedback.
All reactions