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

Feature request for centercrop #12

Closed
hadaev8 opened this issue Nov 6, 2021 · 3 comments
Closed

Feature request for centercrop #12

hadaev8 opened this issue Nov 6, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@hadaev8
Copy link

hadaev8 commented Nov 6, 2021

My dataset has nonsquare samples, so on training, I'm doing random crop and for validation, I'm calculating fid with center cropped copy of dataset.
Would be cool to have some option for passing my own transform, for example.

@GaParmar GaParmar self-assigned this Nov 9, 2021
@GaParmar GaParmar added the enhancement New feature or request label Nov 9, 2021
@GaParmar
Copy link
Owner

GaParmar commented Nov 9, 2021

Thank you for pointing out this use case, I will add this flag in the next version of the library.

@GaParmar
Copy link
Owner

this feature is available in the current clean-fid version 0.1.17
Any transforms can be passed in through the flag custom_image_tranform
You can pass in a function that takes an image as an numpy array as input and returns the transformed image. For instance, the function below can be used to apply a crop to the images when computing the FID score.

    def fn_crop(x):
        return x[60:-60, 60:-60, :]

This option is only applied when the FID is computed between two folders.

@GaParmar
Copy link
Owner

Feel free to re-open this issue if you run into any issues with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants