Obtaining true zero pixels after normalising to Imagenet stats

How do I obtain true zero pixels after I have applied the following transform since the values of 0 pixels change? Is there a way of obtaining the zero values along each color channel separately?

 tfms = transforms.Compose([
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])

Here is my use case.

You could create the masks containing zeros for the black boxes and ones everywhere else, and multiply the normalized input tensor with it.

1 Like