Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grayscale conversion #19

Open
glagnese opened this issue Jun 18, 2023 · 4 comments
Open

Grayscale conversion #19

glagnese opened this issue Jun 18, 2023 · 4 comments

Comments

@glagnese
Copy link

Is there a straightforward way to adapt the model to grayscales (one channel) images?

@nipponjo
Copy link
Owner

Hello,
you can certainly adapt the model to take more or less than 3 image channels as input. I just added a few lines to model/networks.py to make this easier. A generator that takes one-channel images, can be created like this:

# one image channel + mask channel + "ones" channel -> 3 input channels
generator = Generator(cnum_in=3, cnum_out=1)

I also added a few lines to utils/data.py, such that images are converted to greyscale in training, if the number of channels in img_shapes is set to 1 in a config.yaml file.

img_shapes: [256, 256, 1]

@glagnese
Copy link
Author

Hi!

Thanks a lot for your help!

I may have other questions, should I open other issues?

@nipponjo
Copy link
Owner

Hi, if you have other questions you can write them here.

@glagnese
Copy link
Author

Hello!

Thanks once again for your help.

I would like to ask: what should I expect the discriminator loss to behave in a successful training?
So far, it seems it always sticks to 1. Do you have any ideas why is this the case?

G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants