ミニバッチデータスト​アで入力画像(Pat​ch)のサイズを変更​する方法

3 views (last 30 days)
Fork
Fork on 10 Oct 2018
Commented: Fork on 11 Oct 2018
今、上記のミニバッチデータストアのプログラムを参考にしています。私はPatchのサイズを50*50*3に設定し、学習させたいのですが、 (入力層のサイズを50*50*3にしたいため。)上記のプログラムだと入力画像の大きさ(768*1024*3など)になってしまいます。  ImageDataStore のみを用いて、サイズを変更することは可能でしょうか?また、augmentedImageDatastore をもちいなければいけないのでしょうか?

Accepted Answer

mizuki
mizuki on 10 Oct 2018
はい、入力画像のサイズが異なる場合は以下のように augmentedImageDatastore でサイズ合わせをする必要があります。
net = alexnet;
inputSize = net.Layers(1).InputSize;
augimdsValidation = augmentedImageDatastore(inputSize(1:2), imds);
枚数が少なければ imresize を用いて一枚一枚リサイズしても良いですが、augmentedImageDatastore の方がデータストアとして定義した画像に対して一度にリサイズできるので便利かと思います。
  1 Comment
Fork
Fork on 11 Oct 2018
 ご回答いただきありがとうございます。
 質問のプログラムのミニバッチデータストアのどこを変更すれば良いのでしょうか?
 いずれかのイメージデータストアしか使用できなくなっています。

Sign in to comment.

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!