warmspringwinds / pytorch-segmentation-detection

Image Segmentation and Object Detection in Pytorch
MIT License
746 stars 170 forks source link

Difference Between Semantic Segmentation and Image Classification #17

Open mugdhapolimera opened 6 years ago

mugdhapolimera commented 6 years ago

I'm new to implementing CNNs and I'm trying to understand how a model knows whether to perform semantic classification (pixelwise) or image classification (one class per image). As far as I can see, the only difference is in the models/resnet_dilated.py file in the lines resnet34_8s.fc = nn.Conv2d(resnet34_8s.inplanes, num_classes, 1)

whereas most other codes have it as resnet34_8s.fc = nn.Conv2d(resnet34_8s.fc.in_features, num_classes)

Is this the difference between returning a logits of shape [batch x num_classes x H x W] and [batch x num_classes]?