我的情况是使用 FCN 进行像素级预测,我有 7 个类,所以我输入图像 512*512,然后提供 512*512*7 供模型预测,我想根据(高度宽度通道)以保存最终结果。由于我最后使用通道,所以输入形状对我来说很有意义。但是我认为 Keras 拆分出来的输出形状的形式是: (channels*height *width).我的尝试是使用“重塑”功能并且它有效......这真的让我感到困惑,在我的实验中,当我使用重塑功能时,图像会完全搞砸,在这种情况下,结果真的很有效很好(在 Keras 中使用 reshape 函数)。pr = m.predict( np.array([X]))[0]#reshape to channel last and take the largest index in 7 predictions for each piexl pr = pr.reshape(( output_height , output_width , n_classes ) ).argmax(axis=-1)我期望应该很好地工作的方式应该是像 np moveaxis 或 numpy.rollaxis 这样的东西。提前致谢!
添加回答
举报
0/150
提交
取消