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

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

Accepted Answer
More Answers (1)
Aradhy
on 19 Nov 2024
0 votes
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 Comment
Image Analyst
on 19 Nov 2024
Categories
Find more on Lengths and Angles in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!