Skip to content

Change image loading for grayscale support#34

Open
joschkazj wants to merge 1 commit intoyenchenlin:masterfrom
joschkazj:grayscale-support
Open

Change image loading for grayscale support#34
joschkazj wants to merge 1 commit intoyenchenlin:masterfrom
joschkazj:grayscale-support

Conversation

@joschkazj
Copy link

I tried training the model for grayscale input and was having similar issues as mentioned in #12, setting input_c_dim=1 and output_c_dim=1 did not work for me

model = pix2pix(sess, image_size=args.fine_size, batch_size=args.batch_size,
                        output_size=args.fine_size, dataset_name=args.dataset_name,
                        checkpoint_dir=args.checkpoint_dir, sample_dir=args.sample_dir,
                        input_c_dim=1, output_c_dim=1)

After investigating the issue, I changed the image loading function which made the optional reshaping

if (self.is_grayscale):
    batch_images = np.array(batch).astype(np.float32)[:, :, :, None]
else:
    batch_images = np.array(batch).astype(np.float32)

obsolete.

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

Successfully merging this pull request may close these issues.

1 participant