Content-Debiased FVD#
cd-fvd is a library for computing the Fréchet Video Distance (FVD) in Python.
Features include:
Computing FVDs between two sets of videos with I3D or VideoMAE models.
Computing and saving features of videos in different formats.
Precomputed statistics for existing datasets.
Get Started#
# Clone the repository.
git clone https://github.com/songweige/content-debiased-fvd.git
# Install the package.
# You can also install via pip: `pip install cd-fvd`.
cd ./content-debiased-fvd
pip install -e .
# Compute the FVD on two sets of videos.
from cdfvd import fvd
evaluator = fvd.cdfvd('videomae', ckpt_path=None)
evaluator.compute_real_stats(evaluator.load_videos('path/to/realvideos/'))
evaluator.compute_fake_stats(evaluator.load_videos('path/to/fakevideos/'))
score = evaluator.compute_fvd_from_stats()