[英]what is the correct way to reshape image segmentation model output from 2D (num of classes, num of pixels) to 3D channel last images
我正在使用keras和python进行卫星图像分割。 据我了解,要获得图像分割的(像素级)预测,模型会将尺寸(-1,num_classes,height,width)的图层重塑为(-1,num_classes,height * width)的形状,然后再应用激活功能,例如softmax或Sigmoid。 我的问题是在此步骤后以通道优先或通道末尾的格式恢复图像? 示例代码
o = (Reshape(( num_classes , outputHeight*outputWidth)))(o)
o = (Permute((2, 1)))(o)
o = (Activation('softmax'))(o)
我试图在最后添加以下图层到模型
o = (Reshape((outputHeight, outputWidth, num_classes)))(o)
这个对吗? 这会以与原始顺序相同的顺序重新定向图像像素吗? 另一种选择是在单个图像上使用以下代码。
array.reshape(height, width, num_classes)
我应该使用哪种方法来获得像素级分割结果?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.