Hi guys,
I am studying about semantic segmentation these days.
And I need to transform a grey image into a matrix with the value of trainId, as

So, I want to use PyTorch to realize the function of looking up table in a most efficient way.
And your suggestion and idea will be appreciated!