Open lewlin opened 5 years ago
In the current version of the library the segmentation maps are represented as float arrays, where the last axis is comparable to one-hot-vectors, one per pixel. The sum of each such one-hot-vector does not necessarily have to be 1.0
as we only care about the maximum anyways. I.e. no normalization is required or performed. The rule is only that no component of each vector is supposed to be outside of the interval [0.0, 1.0]
and that the argmax along each vector denotes the class index. There is a function -- I think it was called smap.get_arr_int()
-- which returns that discrete class index representation, i.e. what people usually consider an (integer-based) segmentation map. In most cases it is sensible to not access .arr
and instead use that function.
The system is currently quite confusing (and also inefficient), which is why it is going to be replaced by integer maps in the next version of the library.
Hi all,
thank you very (very) much @aleju for the awesome library - really comprehensive and well documented.
I am running into trouble when augmenting segmentation maps. My segmentation maps have size
(H, W, C)
, withC
number of classes. Thedtype
of the map isfloat
and the only entries I use are0.
and1.
This is compatible withSegmentationMapOnImage
documentation. However, when I run an affine transformation on the segmentation map (eg a rotation), the resulting augmented map has all sort of value in it, not only zero and one.For example see code below:
To be a valid segmentation map, the sum along channels should be one for every pixel. Indeed this is what happens for the original map:
for the augmented version this is not true anymore:
Do you think this might be a bug?