HI guys,
In the context of semantic segmentation (19 classes) my model output a tensor of size :
(b, 19, h, w).
I need to merge some classes to get a tensor of size (b, 10, h, w) with respect to a mapping dictionary:
dic = {9:[0,1], 8:[3,4], 7:[9,10,11], 6:[6,7,8], 5:[2,5], 4:[18,17,16], 3:[4,5,6], 2:[12,13], 1:[15], 0:[14]}
What is the most efficient way to do that ?
Thanks !