Only difference i can think of is changing the number of output channels of the model.
Also found a article that might help you
  

      Medium – 22 Jul 21
  

  
    

Multi-Class Semantic Segmentation with U-Net & PyTorch 4

  Learn how to perform image segmentation using Deep Learning and PyTorch.

  
    Reading time: 8 min read