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

Generated texture is not smooth #6

Closed
coderSinol opened this issue Mar 26, 2024 · 1 comment
Closed

Generated texture is not smooth #6

coderSinol opened this issue Mar 26, 2024 · 1 comment

Comments

@coderSinol
Copy link

First of all, this is a great project. Thanks for sharing.

I tried the given sample mansion.zip. However, it generated a texture like this for grass, it is not smooth and contains 4 tile-like areas. Do you have any suggestions to improve this?
azertyuiop_1K_t50_wmean_top-view-realistic-texture-of-o_1

@wonjunior
Copy link
Collaborator

Hi @coderSinol, I appreciate your comment, I also noticed this happening in some instances. During denoising, noise unrolling only enforces a local constraint such that the content of contiguous patches is aligned after decoding. Since decoding is done in batches, the stitching won't be perfectly continuous. I believe the shift in appearance between patches originates from the separate decoding.

It wasn't made very clear in my code but you can try to apply a renormalization step (at the image level after decoding) to try to counter that. It normalizes the patch means with the mean of the entire image. Something like this:

lmean = image_stack.mean(dim=(-1,-2), keepdim=True)
gmean = image_stack.mean(dim=(0,2,3), keepdim=True)
image_stack = image_stack*gmean/lmean

When there are outliers, this might lead to major artifacts, however. So I recommend you also experiment by aligning the median. Let me know if that helps!

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