{"id":24316239,"url":"https://github.com/tsc2017/Frechet-Inception-Distance","last_synced_at":"2025-09-26T23:31:27.328Z","repository":{"id":202257984,"uuid":"158062300","full_name":"tsc2017/Frechet-Inception-Distance","owner":"tsc2017","description":"CPU/GPU/TPU implementation of the Fréchet Inception Distance","archived":false,"fork":false,"pushed_at":"2020-06-20T07:38:07.000Z","size":56,"stargazers_count":81,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-20T09:32:32.015Z","etag":null,"topics":["deep-learning","distance-measures","frechet-distance","gan","generative-model"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsc2017.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-11-18T08:05:57.000Z","updated_at":"2023-10-20T10:50:29.425Z","dependencies_parsed_at":null,"dependency_job_id":"0c7c56bb-84b9-46ec-94ed-c20cb7fd738d","html_url":"https://github.com/tsc2017/Frechet-Inception-Distance","commit_stats":null,"previous_names":["tsc2017/frechet-inception-distance"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsc2017%2FFrechet-Inception-Distance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsc2017%2FFrechet-Inception-Distance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsc2017%2FFrechet-Inception-Distance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsc2017%2FFrechet-Inception-Distance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsc2017","download_url":"https://codeload.github.com/tsc2017/Frechet-Inception-Distance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234360836,"owners_count":18819962,"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":["deep-learning","distance-measures","frechet-distance","gan","generative-model"],"created_at":"2025-01-17T12:19:57.159Z","updated_at":"2025-09-26T23:31:22.042Z","avatar_url":"https://github.com/tsc2017.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Fréchet Inception Distance\nTensorflow implementation of the \"Fréchet Inception Distance\" (FID) between two image distributions, along with a numpy interface. The FID can be used to evaluate generative models by calculating the FID between real and fake data distributions (lower is better).\n\n## Major Dependencies\n- `tensorflow==1.14` or (`tensorflow==1.15` and `tensorflow-gan==1.0.0.dev0`) or (`tensorflow\u003e=2` and `tensorflow-gan\u003e=2.0.0`)\n\n## Features\n- Fast, easy-to-use and memory-efficient\n- No prior knowledge about Tensorflow is necessary if your are using CPUs or GPUs\n- Makes use of [TF-GAN](https://github.com/tensorflow/gan)\n- Downloads InceptionV1 automatically\n- Compatible with both Python 2 and Python 3\n\n## Usage\n- If you are working with GPUs, use `fid.py`; if you are working with TPUs, use `fid_tpu.py` and pass a Tensorflow Session and a [TPUStrategy](https://www.tensorflow.org/api_docs/python/tf/distribute/experimental/TPUStrategy) as additional arguments.\n- Call `get_fid(images1, images2)`, where `images1`, `images2` are numpy arrays with values ranging from 0 to 255 and shape in the form `[N, 3, HEIGHT, WIDTH]` where `N`, `HEIGHT` and `WIDTH` can be arbitrary. `dtype` of the images is recommended to be `np.uint8` to save CPU memory.\n- A smaller `BATCH_SIZE` reduces GPU/TPU memory usage, but at the cost of a slight slowdown.\n- If you want to compute a general \"Fréchet Classifier Distance\" with activations (e.g., outputs of the last pooling layer) `act1` and `act2` from another classifier, call `activations2distance(act1, act2)`. `act1` and `act2` can be numpy arrays of a same arbitrary shape `[N, d]`.\n\n## Examples\nGPU: [![Example In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1hgJJI5wuILxcHsmrkZMkHJtk6uDlKOwr?usp=sharing)\n\nTPU and TF1: [![Example In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1F0fXOKlzIkOSEAdIRa9oyacW34SUX2_v?usp=sharing)\n\nTPU and TF2: [![Example In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Cb8erVc-v6zCG-cLfOWCIjFZPl5zQ4jl?usp=sharing) \n\n## Links\n\n- The Fréchet Inception Distance was proposed in the paper [GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium ](https://arxiv.org/abs/1706.08500)\n- Code for the [Inception Score](https://github.com/tsc2017/Inception-Score)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsc2017%2FFrechet-Inception-Distance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsc2017%2FFrechet-Inception-Distance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsc2017%2FFrechet-Inception-Distance/lists"}