Closed hadaev8 closed 2 years ago
Thank you for pointing out this use case, I will add this flag in the next version of the library.
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.
Feel free to re-open this issue if you run into any issues with this.
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.