pyiqa.archs.inceptionscore_arch¶
Inception score metric, proposed by
Salimans, Tim, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. “Improved techniques for training gans.” Advances in neural information processing systems 29 (2016).
- Reference codes:
Module Contents¶
- class pyiqa.archs.inceptionscore_arch.InceptionScore[source]¶
Bases:
torch.nn.ModuleCompute Inception Score (IS) for a folder of generated images.
- forward(img_dir, mode='legacy_tensorflow', splits=10, num_workers=12, batch_size=32, device=torch.device('cuda'), verbose=True, **kwargs)[source]¶
Compute IS mean and standard deviation.
- Parameters:
img_dir (str) – Directory containing images.
mode (str) – Preprocessing mode used by the Inception feature extractor.
splits (int) – Number of splits used in IS estimation.
num_workers (int) – Number of dataloader workers.
batch_size (int) – Batch size for feature extraction.
device (torch.device) – Device for inference.
verbose (bool) – Whether to print progress.
**kwargs – Unused extra keyword arguments for compatibility.
- Returns:
Dictionary with
inception_score_meanandinception_score_std.- Return type:
dict[str, float]