Hi Thomas, I’ll be more clear.

So for 1 input image, I have 4 masks that correspond to 4 classes.
I converted each mask to binary (0/1)
I stacked these masks to have this dimension [batch, 4, h, w]

Now I want to calculate IoU for each class.