In the example, 25 images are generated. How do I generate one image
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
bohan
el 19 de En. de 2024
Comentada: Image Analyst
el 19 de Nov. de 2024 a las 22:15
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
0 comentarios
Respuesta aceptada
Mike Croucher
el 19 de En. de 2024
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")
Más respuestas (1)
Aradhy
el 19 de Nov. de 2024 a las 16:30
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 comentario
Image Analyst
el 19 de Nov. de 2024 a las 22:15
Ver también
Categorías
Más información sobre Electrical Block Libraries en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!