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

denorm twice in eval_coco.py #11

Open
JJJYmmm opened this issue Nov 10, 2023 · 1 comment
Open

denorm twice in eval_coco.py #11

JJJYmmm opened this issue Nov 10, 2023 · 1 comment

Comments

@JJJYmmm
Copy link

JJJYmmm commented Nov 10, 2023

Hello! I find that /vae/utils/eval_coco.py denorm the reconstruction image twice in line 45.

if hasattr(vae, 'get_codebook_indices'):
                code = vae.get_codebook_indices(mask)
                remask = vae.decode(code)[0, 0, :, :].cpu().numpy() * 0.5 + 0.5 # why denorm here?

because in class func decode, the attr use_norm is True, so decode will denorm the image, but the code denorm after decodeing.
I will try to investigate the effect when evaluating.

@JJJYmmm
Copy link
Author

JJJYmmm commented Nov 10, 2023

Actually, the origin code won't get in the branch. Because this time vae is ddp model. Correct code should be below.

if hasattr(vae.module, 'get_codebook_indices'):
                code = vae.module.get_codebook_indices(mask)
                remask = vae.module.decode(code)[0, 0, :, :].cpu().numpy()

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

1 participant