如何使用cnn训练不同尺寸的图像?

时间:2019-04-29 10:25:34

标签: python tensorflow keras

我想自动将图像(rgb)上的汽车检测为每个像素的可能值。我想创建一个具有0到100个可能值的结果图像,例如,如果某个像素在汽车类别中的概率为98%,则此像素值的结果应该为98。

我希望输入图像的输出图像大小相同。

我的数据                                       标签(仅包含0-100像素值) 例如:

img1.shape = 2238, 3126, 3                  img1.shape   2238, 3126 
img2.shape = 668, 7234, 3                   img2.shape = 668, 7234
img3.shape = 4225, 5598, 3                  img3.shape = 4225, 5598

...

如何训练这些不同大小的数据以及应该为该问题创建哪种网络?

1 个答案:

答案 0 :(得分:0)

您应该调整大小或裁剪。我找到了很好的答案,如下所示:

How to train images, when they have different size ?