In the example, 25 images are generated. How do I generate one image

5 ビュー (過去 30 日間)
bohan
bohan 2024 年 1 月 19 日
コメント済み: bohan 2024 年 1 月 19 日
In this GAN example, 25 images were generated, I wanted to generate 1 image, and I changed the code
‘numValidationImages = 25’ to ‘numValidationImages = 1’
This is the image I generated after training. What went wrong

採用された回答

Mike Croucher
Mike Croucher 2024 年 1 月 19 日
The imtile command should be removed when you only have one image:
Go down to the Generate New Images section and change numObservations
numObservations = 1;
ZNew = randn(numLatentInputs,numObservations,"single");
ZNew = dlarray(ZNew,"CB");
if canUseGPU
ZNew = gpuArray(ZNew);
end
XGeneratedNew = predict(netG,ZNew);
% I = imtile(extractdata(XGeneratedNew)); % Use this if numObservations is > 1
I = extractdata(XGeneratedNew); % Use this if numObservations == 1
I = rescale(I);
figure
image(I)
axis off
title("Generated Images")
  1 件のコメント
bohan
bohan 2024 年 1 月 19 日
Thank you very much. I have solved it.Your advice is very useful

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by