tfa.image.utils.unwrap

View source on GitHub

Unwraps an image produced by wrap.

Where there is a 0 in the last channel for every spatial position, the rest of the three channels in that spatial dimension are grayed (set to 128). Operations like translate and shear on a wrapped Tensor will leave 0s in empty locations. Some transformations look at the intensity of values to do preprocessing, and we want these empty pixels to assume the 'average' value, rather than pure black.

image A 3D Image Tensor with 4 channels.
replace A one or three value 1D tensor to fill empty pixels.

image A 3D image Tensor with 3 channels.