Metrics of GANs

May 9, 2021 · View on GitHub

Maintenance Contributing

  • Fréchet Inception Distance (FID)
  • Inception Score (IS)
  • Number of statistically-Different Bins (NDB)
  • Jensen-Shannon Divergence (JSD)
  • Learned Perceptual Image Patch Similarity (LPIPS)
MetricUsageNotes
FIDImage Qualitythe lower, the better
ISImage Qualitythe higher, the better
NDBDiversitythe lower, the better
JSDDiversitythe lower, the better
LPIPSDiversitythe higher, the better

Configuration

See the environment.yaml. We provide an user-friendly configuring method via Conda system, and you can create a new Conda environment using the command:

conda env create -f environment.yaml

Usage

  • IS:
python eval.py --metric is --pred_list <path/to/pred_list> --gpu_id 0 --resize 299
  • FID:
python eval.py --metric fid --pred_list <path/to/pred_list> --gt_list <path/to/gt_list> --gpu_id 0 --resize 299
  • NBD & JSD:
python eval.py --metric ndb --pred_list <path/to/pred_list> --gt_list <path/to/gt_list> --gpu_id 0 --resize 128
  • LPIPS:
python lpips.py --path <path/to/image_folder> --test_list <path/to/test_list>

Example of test list in LPIPS:

a1.png	a2.png
a1.png	a3.png
...