ミニバッチデータストアで入力画像(Patch)のサイズを変更する方法
2 views (last 30 days)
Show older comments
今、上記のミニバッチデータストアのプログラムを参考にしています。私はPatchのサイズを50*50*3に設定し、学習させたいのですが、 (入力層のサイズを50*50*3にしたいため。)上記のプログラムだと入力画像の大きさ(768*1024*3など)になってしまいます。 ImageDataStore のみを用いて、サイズを変更することは可能でしょうか?また、augmentedImageDatastore をもちいなければいけないのでしょうか?
0 Comments
Accepted Answer
mizuki
on 10 Oct 2018
はい、入力画像のサイズが異なる場合は以下のように augmentedImageDatastore でサイズ合わせをする必要があります。
net = alexnet;
inputSize = net.Layers(1).InputSize;
augimdsValidation = augmentedImageDatastore(inputSize(1:2), imds);
枚数が少なければ imresize を用いて一枚一枚リサイズしても良いですが、augmentedImageDatastore の方がデータストアとして定義した画像に対して一度にリサイズできるので便利かと思います。
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!