Skip to main content

image-evaluator

image-evaluator is a lightweight CLI utility for generative AI practitioners and researchers. It evaluates nine core quality dimensions of synthetic images: predicted visual aesthetics, text-to-image semantic alignment, facial identity preservation, pairwise image fidelity (deep perceptual distance LPIPS, structural similarity SSIM, and peak signal-to-noise ratio PSNR), dataset distribution fidelity (Fréchet Inception Distance FID and Kernel Inception Distance KID), and human preference alignment (PickScore).

Evaluation Workflow

flowchart LR
    A[Task Goal] --> B{Choose --metrics}
    B -->|aesthetic| C[LAION Aesthetic]
    B -->|clip| D[CLIP Similarity]
    B -->|arcface| E[ArcFace Distance]
    B -->|lpips| F[LPIPS Distance]
    B -->|ssim| G[SSIM Similarity]
    B -->|psnr| H[PSNR Ratio]
    B -->|fid| O[FID Distance]
    B -->|kid| P[KID Distance]
    B -->|pickscore| S[PickScore Preference]
    C --> I[Float, Higher Better]
    D --> J[Cosine Sim, Higher Better]
    E --> K[Cosine Dist, Lower Better]
    F --> L[Distance, Lower Better]
    G --> M[Index, Higher Better]
    H --> N[dB, Higher Better]
    O --> Q[Wasserstein-2, Lower Better]
    P --> R[MMD, Lower Better]
    S --> T[Calibrated Likelihood, Higher Better]

Metric Selection

Target Goal Metric Name Required Options Output Direction Technical Details
Visual appeal & quality aesthetic --image Higher is better docs/aesthetic-score.md
Prompt semantic match clip --image, --prompt Higher is better docs/clip-similarity.md
Facial identity consistency arcface --image, --reference Lower is better docs/arcface-distance.md
Deep perceptual similarity lpips --image, --reference Lower is better docs/pairwise-fidelity.md
Structural degradation ssim --image, --reference Higher is better docs/pairwise-fidelity.md
Pixel reconstruction SNR psnr --image, --reference Higher is better docs/pairwise-fidelity.md
Population distribution distance fid --image <dir>, --reference <dir> Lower is better docs/fid.md
Unbiased kernel MMD distance kid --image <dir>, --reference <dir> Lower is better docs/kid.md
Human preference & alignment pickscore --image, --prompt Higher is better docs/pickscore.md

Quick Start

Installation

image-evaluator requires Python 3.11–3.14. Install the release via pip:

python -m pip install image-evaluator==0.2.0

The supported runtime path is macOS or Linux with CPU ONNX Runtime. Linux users who want the GPU runtime can replace onnxruntime with onnxruntime-gpu after installation. Windows is currently unverified.

Tutorial

The CLI enforces explicit metric selection via --metrics and initializes only selected models:

  • --metrics (required): One or more of aesthetic, clip, arcface, lpips, ssim, psnr, fid, kid, pickscore.
  • --image (required): Path to an image file or directory (must be a directory when fid or kid is selected).
  • --prompt: Required when clip or pickscore is selected; prohibited otherwise.
  • --reference: Required when reference-based metrics (arcface, lpips, ssim, psnr, fid, kid) are selected; prohibited otherwise (must be a directory when fid or kid is selected).
  1. Aesthetic evaluation only:

    image-evaluator --metrics aesthetic --image path/to/image.png
    
  2. CLIP text alignment only:

    image-evaluator --metrics clip --image path/to/image.png --prompt "a cat in oil painting style"
    
  3. Pairwise fidelity triad (LPIPS, SSIM, PSNR):

    image-evaluator --metrics lpips ssim psnr --image path/to/image.png --reference path/to/ref.png
    
  4. Dataset distribution metrics (FID and KID):

    image-evaluator --metrics fid kid \
        --reference path/to/real_images/ \
        --image path/to/generated_images/
    
  5. Fidelity triad and distribution joint evaluation:

    image-evaluator --metrics lpips ssim psnr fid kid \
        --reference path/to/reference_dir/ \
        --image path/to/generated_dir/
    
  6. PickScore human preference evaluation:

    image-evaluator --metrics pickscore \
        --image path/to/image.png \
        --prompt "a cat in oil painting style"
    
  7. Multi-metric evaluation across folders:

    image-evaluator --metrics aesthetic clip arcface lpips ssim psnr fid kid pickscore \
        --image path/to/images/ \
        --prompt "a cat in oil painting style" \
        --reference path/to/refs/
    

Interpretation & Protocol Guidelines

  1. Protocol Consistency: Always compare scores under identical model backbones and preprocessing pipelines.
  2. Relative Comparison: Avoid universal absolute thresholds; interpret scores relative to a baseline control.
  3. Fail-Fast Spatial Dimension Policy: Pairwise metrics (lpips, ssim, psnr) strictly reject mismatched image dimensions with ValueError to prevent artificial interpolation distortion. Align sizes beforehand via downsampling or super-resolution.
  4. SSIM Minimum Size: SSIM requires both image dimensions to be at least 11 pixels because it uses the documented 11 × 11 Gaussian window. Smaller inputs fail with ValueError.
  5. Dataset Distribution Contract: Both fid and kid require existing directories on both sides; passing single files is rejected immediately. Neither metric requires filename stem matching ($N_{\text{ref}} \ne N_{\text{gen}}$ is allowed).
  6. Sample Size Sensitivity & Unbiasedness: FID is a biased estimator that overestimates distance on small sample sets ($N < 2048$, triggering a UserWarning). KID is an unbiased U-statistic estimator that can produce finite negative values near zero; these values reflect sample variance around zero and must not be truncated. KID defaults to deterministic seed=0 for bit-exact reproducibility.
  7. Human Preference Alignment: PickScore assesses text-image alignment against trained human preference choices from the Pick-a-Pic dataset (yuvalkirstain/PickScore_v1). Scores are scaled softmax logits (typically in $[15, 25]$ on real benchmarks) where higher scores indicate stronger human preference. PickScore strictly requires an explicit text prompt (--prompt) and evaluates subjective desirability alongside objective fidelity.

Release Status

Area 0.2.0 status
Metrics Aesthetic, CLIP, ArcFace, LPIPS, SSIM, PSNR, FID, KID, PickScore
macOS Verified on Apple Silicon with Python 3.11
Linux Clean install and test suite verified on GitHub Actions with Python 3.11
Windows External Python 3.12 smoke test passed for CLIP, LPIPS, SSIM, and PSNR; full support remains unverified
Dataset metrics FID and KID fully implemented via clean-fid 0.1.35 under clean Inception-v3 protocol with deterministic seed=0
Human preference PickScore fully implemented via PickScore_v1 (yuvalkirstain/PickScore_v1) with calibrated likelihood logits

See CHANGELOG.md for the accepted user-facing changes and known limitations.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image_evaluator-0.2.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

image_evaluator-0.2.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file image_evaluator-0.2.0.tar.gz.

File metadata

  • Download URL: image_evaluator-0.2.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for image_evaluator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5ff5f49ee002ce96843ad835b8d02d2c25d77cfe7c4f0d8c7b524326121c649a
MD5 22c49311731f6fa19240b9d2191be64d
BLAKE2b-256 42cde5e96972fda5cddb98f2c3c1c7835cd258f84b5e51c302dd6114ba321457

See more details on using hashes here.

File details

Details for the file image_evaluator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for image_evaluator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0ac7057e2d51e325f217fb86d8d680b82d52196a96f3f441def9583757dcaec
MD5 a5ad9c2ee1ba80c1c35366a92faa2015
BLAKE2b-256 d0c505f40e103d0eb6fa1d84f8fd25cd4ffe0c33e964a4ff275492d085d1f6a1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.0

2 files

This release

0.2.0 This release

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page