resnet50 implementation for semantic segmentation

I am new to resnet models.

I want to implement a resnet50 model for semantic segmentation I am following the code from this video, but my numclasses is 21. I have a few questions:

  1. If i pass in any rgb jpeg image into the model, I get an output of size (1, 21). What does this output represent?

  2. Since I am doing semantic segmentation, my images dont have any rgb channels, so what should I put for image_channels in self.conv1?

  3. I pass in an image for training, attached below (this image has a label ranging from 0 - 20 for the object class). After the image passes through the resnet mode, and I get an output of something in the shape of (1, 21). What does this output represent?

Topic semantic-segmentation image-segmentation pytorch python

Category Data Science


The output from the ResNet model is a vector containing the probability that the image belongs to each of the n classes, in your case to any of the 21 classes. If you want to use the ResNet model for semantic segmentation you should use a different model structure since the model in the linked video is used for a different type of task (classification). When performing segmentation the model output should be of size (H, W, N_CLASSES) instead of (1, N_CLASSES) which is the case for the model from the video.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.