I’ve worked on plenty of problems where all you need is to find what pixels are a specific color. While I’m sure a NN could be setup for that, why make things harder than they have to be?
torch.all(image == torch.tensor([255,0,0]), dim=-1).nonzero()
To get all pixel pairs (x,y) where the color is red (255,0,0) of the image of shape (width,height,channels).