You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OneHot and ImageToTensor produce different dimension orders #145
ImageToTensor swaps height and width, while OneHot keeps the dimensions of the mask. For an image and a mask of the same size, the two outputs therefore do not line up:
A segmentation pipeline for Flux needs OneHot() |> PermuteDims(2, 1, 3) to get a target with the layout of the input, and a mask used as class indices needs a permutedims. This is easy to miss, because a square image gives matching sizes but a transposed target. Julia 1.13.4, DataAugmentation master (e389a2f).
Proposed outcome
OneHot swaps the first two dimensions of the mask, as ImageToTensor does for images, and puts the classes last: a (height, width) mask becomes (width, height, classes), and a 3D mask (width, height, depth, classes). The one-hot target then has the layout of the input tensor, Flux's WHCN convention once batched. The mask item itself, MaskMulti, keeps the layout of the image it belongs to.
This is breaking: code that relies on (height, width, classes), or permutes the result as #142 does, has to change.
Activity