Home

Awesome

improved-precision-and-recall-metric-pytorch

Improved Precision and Recall Metric for Assessing Generative Models - Unofficial Pytorch Implementation

Paper (arXiv)

Usage

python improved_precision_recall.py [path_real] [path_fake]
python improved_precision_recall.py [path_real] [dummy_str] --fname_precalc [filename_dest]
ipr = IPR(args.batch_size, args.k, args.num_samples)
ipr.compute_manifold_ref(args.path_real)  # args.path_real can be either directory or pre-computed manifold file
metric = ipr.precision_and_recall(images)
print('precision =', metric.precision)
print('recall =', metric.recall)
realism_score = ipr.realism(image_in_tensor)

Discussions

We thank Tuomas for enjoyable discussion.

Link to official repo

https://github.com/kynkaat/improved-precision-and-recall-metric