カスタムミニバッチデ​​ータストアで学習さ​せ​たネットワークを​任意​のサイズの画像​に適用​させる方法

3 ビュー (過去 30 日間)
Fork
Fork 2018 年 10 月 30 日
コメント済み: Fork 2018 年 11 月 4 日
今までは、denoiseImage関数を用いて、学習させていましたが、 ミニバッチデータストア を参考にミニバッチデータストアを用いて、学習させ、ネットワークを作成しましたが、denoiseImageのように任意のサイズの画像に適用できず、学習時の入力画像サイズでしか、ネットワークを適用できません。 ミニバッチデータストアのプログラムを変更する必要があるのでしょうか、それとも別の方法があるのでしょうか。

回答 (2 件)

Tohru Kikawada
Tohru Kikawada 2018 年 11 月 1 日
任意の画像サイズに適用するためには、ミニバッチデータストア内で画像を分割し、画像パッチをまとめてバッチとして渡すような実装が必要です。
denoisingImageDatastore の実装はご覧になりましたでしょうか。下記の397行目に画像パッチを切り出している処理があります。
>> edit denoisingImageDatastore
少し複雑ですが、上記を参考に実装をお試しください。
  1 件のコメント
Fork
Fork 2018 年 11 月 4 日
お忙しいところ、ご回答いただきありがとうございました。
for i = 1:ds.MiniBatchSize ds.CurrentFullImage = im2double(ds.InputImageDatastore.readimage(ds.CurrentImageIndex)); rowLocations = randi(max(size(ds.CurrentFullImage,1)-50,1), i, 1); colLocations = randi(max(size(ds.CurrentFullImage,2)-50,1), i, 1); patches{i} = ds.CurrentFullImage(rowLocations(i):rowLocations(i)+49,... colLocations(i):colLocations(i)+49, :);
このように直してみましたが、50*50のままでした。 denoisingImageDatastore のように、画像パッチをまとめてバッチとして渡すためには、どのようなコードの追加が必要でしょうか
また、denoisingImageSourceでも、偽色を取り除くことは可能なのでしょうか

サインインしてコメントする。


Fork
Fork 2018 年 11 月 2 日
お忙しいところ、ご回答いただきありがとうございました。
for i = 1:ds.MiniBatchSize
ds.CurrentFullImage = im2double(ds.InputImageDatastore.readimage(ds.CurrentImageIndex));
rowLocations = randi(max(size(ds.CurrentFullImage,1)-50,1), i, 1);
colLocations = randi(max(size(ds.CurrentFullImage,2)-50,1), i, 1);
patches{i} = ds.CurrentFullImage(rowLocations(i):rowLocations(i)+49,...
colLocations(i):colLocations(i)+49, :);
このように直してみましたが、50*50のままでした。
denoisingImageDatastore のように、画像パッチをまとめてバッチとして渡すためには、どのようなコードの追加が必要でしょうか
また、denoisingImageSourceでも、偽色を取り除くことは可能なのでしょうか

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!