Adjusting the Generative adversarial network example

Hi. I want to feed grayscale images to the GAN and get grayscale images as output, but the generator layer is defined in a way that produces RGB images. How can I change this layer to produce grayscale images? Also, is there any other modifications needed in the training GAN provided by MATLAB in the following link?
I have tried changing the filter numbers of the last layers of both generator and discriminater from 3 to 1, but I end up with plain blue images during the learning process.

2 件のコメント

Eaby Babu
Eaby Babu 2021 年 1 月 14 日
Hi, Have you found a solution to train gray-scale images?
Natalia da Silva de Sá
Natalia da Silva de Sá 2021 年 11 月 11 日
I fixed the blue image problem just changing the part of the code that display the images. So instead of image(I), I used imshow(I).

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

回答 (1 件)

yanqi liu
yanqi liu 2021 年 11 月 12 日

0 投票

sir,may be use
augmentedImageDatastore(data,'ColorPreprocessing','gray2rgb');

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 5 月 10 日

回答済み:

2021 年 11 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by