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

Differentiable JPEG function wrong positional argument name #2836

Open
Fleyderer opened this issue Mar 12, 2024 · 2 comments
Open

Differentiable JPEG function wrong positional argument name #2836

Fleyderer opened this issue Mar 12, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Fleyderer
Copy link
Contributor

Fleyderer commented Mar 12, 2024

Describe the bug

kornia.enhance.jpeg_codec_differentiable() requires input positional argument while there is no such argument in function

I know that it is because of @perform_keep_shape_image decorator, but this behaviour is not normal

And yes, it is working if I change image_rgb=a to input=a

Reproduction steps

1.

 pip install git+https://github.com/kornia/kornia

2.

import torch 
import kornia

a = torch.rand(4, 3, 112, 112)
kornia.enhance.jpeg_codec_differentiable(
    image_rgb=a, 
    jpeg_quality=torch.full([a.shape[0]], 15))

3.

TypeError: jpeg_codec_differentiable() missing 1 required positional argument: 'input'

Expected behavior

Expected behaviour is to have ability of using named arguments in function

Environment

I think it does not matter in this case

Additional context

No response

@Fleyderer Fleyderer added the help wanted Extra attention is needed label Mar 12, 2024
@johnnv1
Copy link
Member

johnnv1 commented Mar 12, 2024

this seems an issue related to the decorator perform_keep_shape_image cc @edgarriba @ChristophReich1996

def perform_keep_shape_image(f: Callable[..., Tensor]) -> Callable[..., Tensor]:

@edgarriba
Copy link
Member

edgarriba commented Mar 13, 2024

Ideally we rename to input and more ideally as a meta task we standardise that across the library /cc @johnnv1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants