class FVD
Source code in aigve/metrics/video_quality_assessment/distribution_based/fvd.py
__init__(model_path, feature_layer=-2)
Initialize the FVDScore evaluator.
Parameters: model_path (str): Path to the pre-trained I3D model. feature_layer (int or str): The layer of the I3D model to use for feature extraction.
Source code in aigve/metrics/video_quality_assessment/distribution_based/fvd.py
calculate_fvd(videos1, videos2)
Calculate the FVD score between two sets of videos.
Parameters: videos1 (numpy array): First set of videos of shape (num_videos, num_frames, height, width, channels). videos2 (numpy array): Second set of videos of shape (num_videos, num_frames, height, width, channels).
Returns: float: The FVD score.
Source code in aigve/metrics/video_quality_assessment/distribution_based/fvd.py
calculate_statistics(videos)
Calculate the feature statistics (mean and covariance) for a set of videos.
Parameters: videos (numpy array): Preprocessed videos.
Returns: tuple: Mean and covariance of the features.
Source code in aigve/metrics/video_quality_assessment/distribution_based/fvd.py
load_i3d_model(model_path, feature_layer)
staticmethod
Load a pre-trained I3D model for feature extraction.
Parameters: model_path (str): Path to the pre-trained I3D model. feature_layer (int or str): The layer of the I3D model to use for feature extraction.
Returns: Model: The I3D model for feature extraction.
Source code in aigve/metrics/video_quality_assessment/distribution_based/fvd.py
preprocess_videos(videos)
Preprocess videos for the I3D model.
Parameters: videos (numpy array): Input videos as a numpy array of shape (num_videos, num_frames, height, width, channels).
Returns: numpy array: Preprocessed videos.