{"id":17801639,"url":"https://github.com/matthias-wright/jax-fid","last_synced_at":"2025-03-17T11:30:52.916Z","repository":{"id":36955393,"uuid":"390595903","full_name":"matthias-wright/jax-fid","owner":"matthias-wright","description":"FID computation in Jax/Flax.","archived":false,"fork":false,"pushed_at":"2024-07-17T07:19:14.000Z","size":58647,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T23:09:57.130Z","etag":null,"topics":["fid","flax","frechet-inception-distance","jax"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthias-wright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-29T04:05:43.000Z","updated_at":"2025-02-18T08:01:09.000Z","dependencies_parsed_at":"2024-07-17T09:27:41.284Z","dependency_job_id":null,"html_url":"https://github.com/matthias-wright/jax-fid","commit_stats":{"total_commits":6,"total_committers":3,"mean_commits":2.0,"dds":"0.33333333333333337","last_synced_commit":"d02504b2166cef1a96c7b6f6e95e09e6dbb148ba"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-wright%2Fjax-fid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-wright%2Fjax-fid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-wright%2Fjax-fid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthias-wright%2Fjax-fid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthias-wright","download_url":"https://codeload.github.com/matthias-wright/jax-fid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858573,"owners_count":20359375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fid","flax","frechet-inception-distance","jax"],"created_at":"2024-10-27T12:39:05.693Z","updated_at":"2025-03-17T11:30:47.905Z","avatar_url":"https://github.com/matthias-wright.png","language":"Python","funding_links":[],"categories":["Models and Projects"],"sub_categories":["Flax"],"readme":"# FID computation in Jax/Flax\n\nThis is a port of [mseitzer/pytorch-fid](https://github.com/mseitzer/pytorch-fid), which is a port of the original FID implementation ([bioinf-jku/TTUR](https://github.com/bioinf-jku/TTUR)).\n\nThe parameters for the [InceptionV3](https://arxiv.org/abs/1512.00567) network are taken from [mseitzer/pytorch-fid](https://github.com/mseitzer/pytorch-fid). The FID scores are almost identical (absolute difference around 1e-7).  \nThe only difference is that [mseitzer/pytorch-fid](https://github.com/mseitzer/pytorch-fid) [resizes](https://github.com/mseitzer/pytorch-fid/blob/d042ab8a9f8e4b388c21bc7b38d9599c5fbcfe7b/src/pytorch_fid/inception.py#L146) the images to 299x299 by default. In this implementation, the images are not resized by default. You can resize the images using the `--img_size` argument. \n\n\n## Installation\nYou will need Python 3.7 or later.\n \n1. For GPU usage, follow the \u003ca href=\"https://github.com/google/jax#installation\"\u003eJax\u003c/a\u003e installation with CUDA.\n2. Then install:\n   ```sh\n   \u003e pip install jax-fid\n   ```\nFor CPU-only you can skip step 1.\n\n## Usage\n\n### Compute FID score\n```python\n\u003e CUDA_VISIBLE_DEVICES=N python -m jax_fid --path1 /path/to/dataset1 --path2 /path/to/dataset2\n```\nwhere `N` is the GPU index.\n\n### Pre-compute statistics for image directory\n```python\n\u003e CUDA_VISIBLE_DEVICES=N python -m jax_fid --precompute --img_dir /path/to/dataset --out_dir /path/to/stats\n```\n\n### Arguments\n`--path1` - Path to image directory or .npz file containing pre-computed statistics.  \n`--path2` - Path to image directory or .npz file containing pre-computed statistics.  \n`--batch_size` - Batch size per device for computing the Inception activations.  \n`--img_size` - Resize images to this size. The format is (height, width).  \n`--precompute` - If True, pre-compute statistics for given image directory.  \n`--img_dir` - Path to image directory for pre-computing statistics.   \n`--out_dir` - Path where pre-computed statistics are stored.   \n`--mmap` - If True, use mmap to compute statistics.   \n`--mmap_file` - Name of mmap file. Only used if mmap is True.   \n\n\n## License\nApache-2.0 License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthias-wright%2Fjax-fid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthias-wright%2Fjax-fid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthias-wright%2Fjax-fid/lists"}