-
Notifications
You must be signed in to change notification settings - Fork 518
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
Python API #59
base: master
Are you sure you want to change the base?
Python API #59
Conversation
� Conflicts: � src/pytorch_fid/fid_score.py
Hi, thank you for the PR; I was aware of this problem as well and wanted to introduce a Python API at some point. So it's great that you took the time to implement this! At the moment, I do not have time to review your PR, but I will get to it eventually. Just wanted to let you know that I am aware of your PR. |
Thank you for the reply. I'm currently not 100% satisfied with my proposed approach and hence might a few more changes in the future. |
Any chance of this being merged? Or possibly just a recommendation on how to use the library as a Python API? |
@murnanedaniel you can either use my fork of this repository, but which also hasn't been updated in a while and may no longer work or look for other implementations with a better API. https://github.com/w86763777/pytorch-gan-metrics seems to do a good job, for example. |
I just went away an implemented this and was going to open a PR when I saw this, guess I should have checked the branches! I also moved to an object orientated aproach so I generaly approve of the approach, allthough I would have the model instatiated within the class just to simplify the end users code. An optional override could be supplied for the model but I imagine the vast majority of users would use the default. Edit: |
Many thanks for your awesome project! While it works perfectly using the provided command line script, it's not straightforward to use it directly from code, e.g. when the FID computation should be integrated into the training loop.
To improve on this issue, I refactored the FID code to be now contained in a single class and with the methods less coupled to each other. The former command line script still works as before, with only minor changes to the interface. Loading activation statistics from a file also works as before but computed stats can now also be cached automatically using the
--cache
flag.Example usage from code may look as follows:
Tests have been updated as well and linter passes.