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

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

 Akzeptierte Antwort

mizuki
mizuki am 10 Okt. 2018

3 Stimmen

はい、入力画像のサイズが異なる場合は以下のように augmentedImageDatastore でサイズ合わせをする必要があります。
net = alexnet;
inputSize = net.Layers(1).InputSize;
augimdsValidation = augmentedImageDatastore(inputSize(1:2), imds);
枚数が少なければ imresize を用いて一枚一枚リサイズしても良いですが、augmentedImageDatastore の方がデータストアとして定義した画像に対して一度にリサイズできるので便利かと思います。

1 Kommentar

Fork
Fork am 11 Okt. 2018
 ご回答いただきありがとうございます。
 質問のプログラムのミニバッチデータストアのどこを変更すれば良いのでしょうか?
 いずれかのイメージデータストアしか使用できなくなっています。

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018a

Gefragt:

am 10 Okt. 2018

Kommentiert:

am 11 Okt. 2018

Community Treasure Hunt

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

Start Hunting!