say4n / pytorch-segnet

SegNet implementation in Pytorch framework
MIT License
88 stars 35 forks source link

initializing from VGG pretrained model #3

Closed deepaksinghcv closed 5 years ago

deepaksinghcv commented 5 years ago

Hey, In the model.py file, the self.init_vgg_weigts() function has initialization of weights of 21,24,26th layer for the last 3 convolution layers, shouldn't it be 24,26,28th layer. Kindly correct me if i'm wrong. Thank you

say4n commented 5 years ago

Hey, @deepakksingh thanks for catching this! It's fixed now. :)

deepaksinghcv commented 5 years ago

i have a question , for a random test image, how will i interpret the tensor, it's in the shape [batchsize,22,224,224], where 22 is the number of possible class labels and 224 is image width and height. In the forward pass, I'm doing softmax after the decoder output. what next?

Thank you.

say4n commented 5 years ago

In the task of semantic image segmentation, each pixel is assigned a class label. So, doing softmax + argmax on the n x n x c tensor will help you get the pixel-wise class labels.

deepaksinghcv commented 5 years ago

In your inference.py file at line 80: predicted_mx = predicted_mx.argmax(axis=0) shouldn't it be predicted_mx = predicted_mx[predicted_mx.argmax(axis=0)] (or something similar to the above..so that we can fetch the maximum values) so that we choose the max predictions from each channel.

deepaksinghcv commented 5 years ago

In your inference.py file at line 80: predicted_mx = predicted_mx.argmax(axis=0) shouldn't it be predicted_mx = predicted_mx[predicted_mx.argmax(axis=0)] (or something similar to the above..so that we can fetch the maximum values) so that we choose the max predictions from each channel.

No worries, I solved that. thank you