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

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

 Risposta accettata

mizuki
mizuki il 10 Ott 2018

3 voti

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

1 Commento

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange

Prodotti

Release

R2018a

Richiesto:

il 10 Ott 2018

Commentato:

il 11 Ott 2018

Community Treasure Hunt

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

Start Hunting!