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

How to get three channel output from IDWT? #3

Open
SusmitaSenGhosh opened this issue May 18, 2022 · 4 comments
Open

How to get three channel output from IDWT? #3

SusmitaSenGhosh opened this issue May 18, 2022 · 4 comments

Comments

@SusmitaSenGhosh
Copy link

I have a three-channel image (RGB). While performing IDWT using the coefficients obtained from DWT, I got one channel output. Can you please let me know how to obtain three-channel output from IDWT?

@Timorleiderman
Copy link
Owner

Thenk you for openning this issue.

I see the problem, for now I will recommand you to do the dwt for each channel separatly.
I will work on a fix for this issue hopefully I will fix it soon

@SusmitaSenGhosh
Copy link
Author

Thanks. That is what I am doing now. It would be of help if it can be generalized for n-channel inputs. Thanks again.

@ChilloutCharles
Copy link

Any updates on this? I would like to be able to use this for a project I am working on. I am able to get the right numbers for the output, but the shape seems to be wrong.

Here's the code i am using to test it out

if __name__ == '__main__':
    transform = DWT(name='db4', concat=0)
    inverse = IDWT(name='db4', concat=0)
    ones = tf.ones((3, 160, 64, 1))

    output = transform(ones)
    inverted = inverse(output)
    print(ones.shape, output.shape, inverted.shape)
    # expect to be (3, 160, 64, 1) (3, 80, 32, 4) (3, 160, 64, 1)
    # found to be  (3, 160, 64, 1) (3, 80, 32, 4) (3, 64, 160, 1)

@Timorleiderman
Copy link
Owner

Timorleiderman commented Dec 20, 2024

Thanks, I added a fix for the shape issue

and added a test for it :)

def test_shapes(self):

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

3 participants