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

4 Ansichten (letzte 30 Tage)
Fork
Fork am 30 Okt. 2018
Kommentiert: Fork am 4 Nov. 2018
今までは、denoiseImage関数を用いて、学習させていましたが、 ミニバッチデータストア を参考にミニバッチデータストアを用いて、学習させ、ネットワークを作成しましたが、denoiseImageのように任意のサイズの画像に適用できず、学習時の入力画像サイズでしか、ネットワークを適用できません。 ミニバッチデータストアのプログラムを変更する必要があるのでしょうか、それとも別の方法があるのでしょうか。

Antworten (2)

Tohru Kikawada
Tohru Kikawada am 1 Nov. 2018
任意の画像サイズに適用するためには、ミニバッチデータストア内で画像を分割し、画像パッチをまとめてバッチとして渡すような実装が必要です。
denoisingImageDatastore の実装はご覧になりましたでしょうか。下記の397行目に画像パッチを切り出している処理があります。
>> edit denoisingImageDatastore
少し複雑ですが、上記を参考に実装をお試しください。
  1 Kommentar
Fork
Fork am 4 Nov. 2018
お忙しいところ、ご回答いただきありがとうございました。
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でも、偽色を取り除くことは可能なのでしょうか

Melden Sie sich an, um zu kommentieren.


Fork
Fork am 2 Nov. 2018
お忙しいところ、ご回答いただきありがとうございました。
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でも、偽色を取り除くことは可能なのでしょうか

Kategorien

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

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!