mseitzer / pytorch-fid

Compute FID scores with PyTorch.
Apache License 2.0
3.22k stars 497 forks source link

Store npz file #80

Closed jwblangley closed 1 year ago

jwblangley commented 2 years ago

Summary

As per my own experience and Issue #77, I believe that the ability to save an npz file is a significant missing feature to this otherwise great tool! So I went and implemented it! The user can simply specify the --save-stats flag and the stats of the first path will be generated and saved in the location of the second path.

Changes

Test Plan

I have manually tested the new workflow and the original and they behave exactly as expected. By logical inspection of the changes I've made, I believe no errors will have been introduced, however, I failed to run the included test suite due to an error that is present on master - prior to my changes. The error I am receiving is:

TypeError: compute_statistics_of_path() got an unexpected keyword argument 'num_workers'

Please advise how to fix this and I can rerun the test suite.

Code formatting

I have done my best to copy the style in which the existing code is written. I could not find a linter that is in use - if there is one, please make me aware of it.

allglc commented 2 years ago

Thanks for the implementation, it works well for me!

mseitzer commented 1 year ago

Thanks for the PR, looks good to me!