GaParmar / clean-fid

PyTorch - FID calculation with proper image resizing and quantization steps [CVPR 2022]
https://www.cs.cmu.edu/~clean-fid/
MIT License
903 stars 69 forks source link

Create `stats_folder` if not exists #11

Closed bruce-willis closed 2 years ago

bruce-willis commented 2 years ago

There is a small bug that a stats directory is not created automatically. This leads to an exception when creating custom dataset statistics. Example: https://colab.research.google.com/drive/13WFqmUYJEgyJ9LEnVtIBFL9b3Crx_t7i?usp=sharing

Relevant comment: https://github.com/GaParmar/clean-fid/issues/9#issuecomment-919837187

P.S. sorry for such a small PR, but I've encountered this issue a couple of times already (different machines and conda environments), and I always forget to create a stats folder beforehand. And only after waiting for computation for the whole dataset, I receive this error. Awesome work and repo after all!